Refactor the API with thread-safety

- Remove lazy initialization of helper properties
- Add 'interrupt' method to the stream class, which allows other threads to
  call API functions while another one is blocking on `next_event`
- Synchronize access to `next_event`/`msgpack_rpc_call`