make map erase thread safe