Properly reset the internal handle in DynamicLib::Close