Wigan Athletic lost for the first time in five matches as League One play-off chasers Huddersfield Town edged a scrappy game in West Yorkshire by the only goal.