tests: added a thread_sleep() at the end

Letting the main thread exit could cause failing test if thread_exit()
is broken for the tested platform, preventing the actual testing of the
hwtimer.
Merge pull request #1083 from OlegHahm/test_hwtimer_w_thread_sleep

tests: added a thread_sleep() at the end
core: prefix API functions correctly

Also changed names for bitarithm functions and rename thread_pid to sched_active_pid.