fix: fix race condition in remote calls (#329)
fix: fix race condition in remote calls (#329)

The wrapper, `_remote.RemoteCall`, added to help attach debugging into
to gRPC calls, inadvertantly introduced a race condition between the
gRPC thread and the NDB thread, where the gRPC thread might call
`RemoteCall._finish` *during* a call to `RemoteCall.add_done_callback`.

The solution, here, is to turn `RemoteCall.add_done_callback` into a
direct pass-through to `grpc.Future.add_done_callback` on the wrapped
future. The callback which is eventually executed in the gRPC thread,
only pushes the finished RPC onto a `queue.Queue` which is eventually
consumed by the event loop running in the NDB thread.

Fixes #302.
googleapis/python-ndb,googleapis/python-ndb