Giants hold on to beat Mets 4-3 in 10 innings