Finalize config before library cleanup.

Toward a fix of #87.