Pass the tsdb and query variables around, instead of using instance variables.

As only one instance is created in the RpcHandler, the instance variables were being overwritten
in a concurrent situation. By passing them around, we make this thread-safe.
Fixes #306.

Signed-off-by: Chris Larsen <clarsen@euphoriaaudio.com>