AP_Compass: use apply_correction function to eliminate duplication