49ers defeat formerly undefeated Eagles