Bug 1036367 - Fix dangerous public destructors in im/. r=aleth