Police Scotland pay out almost £1m over sexism case