49ers hand Eagles first loss of the season