AP_Compass: use apply_correction_function to eliminate duplication