Mutable/immutable borrow conflict for "scan for a key to remove from a map" pattern - how to resolve?