Fixes socket EOS crash in handleModuleMsg.