add unittest for finalization during library unload
finalize objects whose shared library is about to be unloaded
Merge pull request #658 from MartinNowak/finalizeLibrary

[dll] finalize objects whose shared library is about to be unloaded