Dodgers beat Brewers 4-3 to avoid sweep