Longoria's 3-run double rallies Giants past Dodgers 3-2