fix #27 thread tests hang on Ubuntu