fix shared library finalize issue

This should fix https://github.com/D-Programming-Language/druntime/pull/864