linux hangs fix update for the experimental branch blackdots

Better solution for the Linux hangs and crashes that avoids sporadic crashes to preview due to double joins.

It works fine in Linux 32 bits and 64 bits, but I had to modify a common Windows-Linux part of the code, so it should be tested in Windows as soon as possible to ensure it does not cause problems there.