Keep heading error within [-180,180]