style: Deduplicate a bit the malloc_size_of code for hashmaps / hashsets.
style: Deduplicate a bit the malloc_size_of code for hashmaps / hashsets.

This allows to experiment with other hash maps easily rather than
depending on what hashglobe::fake::HashMap dereferences to.

In particular I wrote it while trying to get a build working with hashbrown.

Differential Revision: https://phabricator.services.mozilla.com/D14098

notriddle/servo,DominoTree/servo,pyfisch/servo,KiChjang/servo,KiChjang/servo,notriddle/servo,pyfisch/servo,szeged/servo,saneyuki/servo,emilio/servo,larsbergstrom/servo,szeged/servo,larsbergstrom/servo,paulrouget/servo,nnethercote/servo,KiChjang/servo,paulrouget/servo,peterjoel/servo,DominoTree/servo,saneyuki/servo,nnethercote/servo,szeged/servo,szeged/servo,larsbergstrom/servo,notriddle/servo,pyfisch/servo,larsbergstrom/servo,larsbergstrom/servo,DominoTree/servo,paulrouget/servo,nnethercote/servo,saneyuki/servo,peterjoel/servo,larsbergstrom/servo,larsbergstrom/servo,KiChjang/servo,splav/servo,peterjoel/servo,nnethercote/servo,DominoTree/servo,szeged/servo,splav/servo,splav/servo,nnethercote/servo,paulrouget/servo,szeged/servo,paulrouget/servo,saneyuki/servo,nnethercote/servo,emilio/servo,pyfisch/servo,notriddle/servo,emilio/servo,pyfisch/servo,pyfisch/servo,paulrouget/servo,nnethercote/servo,peterjoel/servo,KiChjang/servo,emilio/servo,notriddle/servo,pyfisch/servo,saneyuki/servo,larsbergstrom/servo,saneyuki/servo,peterjoel/servo,szeged/servo,emilio/servo,DominoTree/servo,paulrouget/servo,peterjoel/servo,saneyuki/servo,saneyuki/servo,paulrouget/servo,notriddle/servo,DominoTree/servo,emilio/servo,KiChjang/servo,KiChjang/servo,saneyuki/servo,szeged/servo,notriddle/servo,KiChjang/servo,splav/servo,nnethercote/servo,peterjoel/servo,larsbergstrom/servo,emilio/servo,notriddle/servo,DominoTree/servo,paulrouget/servo,peterjoel/servo,peterjoel/servo,emilio/servo,pyfisch/servo,splav/servo,DominoTree/servo,paulrouget/servo,KiChjang/servo,splav/servo,splav/servo,splav/servo,splav/servo,notriddle/servo,szeged/servo,pyfisch/servo,nnethercote/servo,nnethercote/servo,emilio/servo,pyfisch/servo,emilio/servo,notriddle/servo,peterjoel/servo,DominoTree/servo,KiChjang/servo,DominoTree/servo,splav/servo,saneyuki/servo,larsbergstrom/servo,szeged/servo