Optimize common path
Add dispose checks to ReaderWriterLockSlim and fix race in currentThreadState initialization