Fixing memory leak with hash table for MPI