Ensure NrtFutures are notified promptly of new search generation

The internal waiting generation counter in
ControlledRealTimeReopenThread is only increased when
waitForGeneration is called. This controls whether the min or max
refresh time is used for waiting. Because NrtFuture.get is not called
directly and listeners may be used instead, this was not guaranteed
to happen, leading to long delays. Fix this by doing a dummy wait for
0ms at future construction time.

Change the order of refresh listener initialization so any
removeIfDone calls are made only after the internal listener within
ControlledRealTimeReopenThread updates its searching generation.

Change-Id: I0edf4a3d38a160496afaf0587cf14b6fee2f2aa5
1 file changed