Pirates win 4th straight, 3-2 over Royals