Destroy plugins in a controlled manner if init fails

Not doing it explicitly leaves it up to the random order of static destruction,
which can make the static plugin factory be deleted before the plugin which
must use that factory. Fixes #34.
Merge branch '1.8-stable'