Burnley move a step closer to Premier League safety as they win an away game for the first time this season with victory at Crystal Palace.