ath9k: fix various calibration related bugs and clean up the code