safely run context for NSManagedObject