fix for #25 by using mutexes for hwtimer_wait