use thread instead of fork() in unit test.