Fix Core Data threading issue when saving objects

The `-managedObjectFromModel:insertingIntoContext:error:` call will attempt to insert an object into the database and will sometimes fail (especially with large datasets) since it is not running in the same Core Data queue.