arch: fix clearing of hash table in memlayout destructor
arch: fix clearing of hash table in memlayout destructor

First advance iterator, then delete element. Fixes use-after-free
in destructor.

phate/jive,phate/jive,phate/jive