Unload registry plugin at the end.

The installer and the uninstaller don't remove the $PLUGINSDIR directory. The
problem is caused by the registry plugin. It's needed unload the plugin before
the installer and the uninstaller end up.

This commit closes #2078.