Barcelona beat Getafe to end struggles on the road