fix deadlocks and crashes on limit due to usage of a signal handler which executed nontrivial code

closes #93

there was a bug in the sleepIdle() macro which has been fixed since.
however, a closed pull request does not allow adding commits so i'm making a new one.