[TSan] Add -lpthread to the test which uses pthread_ functions