Garoppolo Leads Game-Winning Drive, 49ers Beat Bears