Make implementation of hwtimer_spin() easier to read and understand
Merge pull request #1002 from rousselk/fix-hwtimer-spin-wait

Enhance implementation of hwtimer_spin()