Fix Process.state deadlock, add a test
Merge pull request #45 from bmjames/state

Fix Process.state deadlock