Pirates hand Astros 10th loss in row with 5-3 win