MFC r200652
MFC r200652

 If the runcount is non-zero in eventhandler_deregister() then one or more
 threads are executing the eventhandler, sleep in this case to make it safe for
 module unload. If the runcount was up then an entry would have been marked
 EHE_DEAD_PRIORITY so use this as a trigger to do the wakeup in
 eventhandler_prune_list().

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase