fix race condition in hwtimer_spin