Correct the logic to timeout a worker thread.

Before timeout is only set on the future. Future.get() will return
after the timeout, but the worker thread may be running forever.

The current logic is to submit a terminator thread after the timeout to
cancel the future. As scheduledExecutorService uses a threadpool, terminated
thread would get replenished.