thread-pool: Avoid deadlock when there are no working threads

maTasksComplete.wait() would never finish because there are no threads
working and thus ThreadPool::stopWork() won't be called.

Change-Id: I7103bdb779eb66a65cd8496091e72a0c65eb3567