fix thread safety tests run under debug build