Fix: plugin: remove memory leak in legacy code
Merge pull request #318 from l-mb/master

Fix small memory leak in legacy plugin code
Fix: legacy: Handle messages in the common way in the plugin dispatch function by default