Observed on Ubuntu Linux. Occasionally, the loop checking the
condition_variable in the plugin scanner would spin indefinitely.
The cause appears to be that handleMessageFromWorker could be
called immediately after sendMessageToWorker, but before locking the
mutex. If this happens, gotResponse will be false during every call to
condvar.wait_for, and the loop will never exit.
The rewritten version of the scanner always resets gotResult immediately
after the condvar is woken successfully, so a call to
handleMessageFromWorker or handleConnectionLost will always cause a
subsequent call to condvar.wait_for to exit successfully.
The Superprocess class has also been refactored and extracted to avoid
a circular dependency between Superprocess and CustomPluginScanner.