Fix wakeup of solution thread.

Check timer counter when resetting period and use a semaphore to
wake up.  Fixes #69

<!---
@huboard:{"order":106.5,"milestone_order":140,"custom_state":""}
-->