[asan] Use -pthread instead of -lpthread in tests.