Note on thread safety of realloc