Fixed occasional deadlock problems

A quote I found on an SO question that triggered this solution was: 

**"You don't want to call performBlock on the private queue context in case it happens to be on the main thread which will cause a deadlock."**

I went in and for all of the non-backing store contexts, I added a check for [NSThread isMainThread] before calling the performBlock/performBlockAndWait methods.

This approach has solved the deadlock problems I have been having.