Fix fatal errors from  altering $map

#6487 

The $map variable was changed when _menu_load_objects was called, this created unexpected results when the alter was run multiple times on the same menu item.