[SharpDX] Fix issue in release build with new ComObject management