Eagles beat Cowboys 24-22 to take NFC East title