Closes #50: Avoid problems with sleep function in mixed gevent/threading setup