Alex noted that the initial locking around WriteKey and ReadKeys is ugly and somewhat unsafe. This is a reminder that we agreed to go back and make these two std:: objects into classes that include read/write locks and exception management in a future PR.
@toktarev