FIX: shared object unregistration crash in VS2012
removing dictionary key from dictionary that was currently iterated caused crash