Patriots deal QB Jimmy Garoppolo to 49ers for 2018 draft pick