Fixes a "Collection was mutated while being enumerated" error

I regularly encountered a crash while saving a MOC. This, as far as I can tell, stems from background threads calling `[context performBlock:]` while another thread is saving. Those concurrent saves would lead to a  `*** Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection was mutated while being enumerated.'` error. Encapsulating the `obtainPermanentIDsForObjects:` in a `performBlockAndWait:` seems to fix this problem.