Avoid thread death after start

Almost all threads were diying after the webserver start. This was due
to the mispositioning of a boolean that has now been moved up.
Solved warnings at compile time inherent virtual destructors