Changed the monitor.php to use ZMQPoll to receive replies to queries. As this has a timeout.
This should stopp the issues with php processes being left running and blocking access to the CW process.