fix mem leak in test
quit and join threads
quit_and_join() once