Add precondition check that all persistent storage related methods should be invoked in main thread.