IPC: move plugin monitor related code to PluginMonitor