Made closeWithCode:reason: safer by moving readyState change into the work queue
Merge pull request #67 from tenthbitinc/master

Make closeWithCode:reason: safer by moving readyState change to work queue