Giants hold off Cubs 4-3