Fix server deadlock issue.

Fixes #36.
Merge pull request #59 from oharaandrew314/fix-deadlock-issue

Fix server deadlock issue.