Fixed|libcore|TaskPool: Completing a pool while it is being destroyed

The allTasksDone() signal was emitted after unlocking, which meant that
a destructor waiting on the mutex would get a chance to complete too
early.