Wait for threads of the global thread pool to be done when clearing

nodes: this way the thread storage objects are destroyed after that the
thread pool's threads are destroyed.
Cleaner node creation dialog popup and position it where the cursor is.