Core: server-side plugin shutdown() hook (#594).

Plugins can use a new hook:
{{{
@Override
public void shutdown() {
    ...
}
}}}

It is triggered when OSGi stops a plugin.

Close #594.