Wigan move out of the League One drop zone thanks to victory over Huddersfield, whose own play-off hopes take a dent.