Fix itemdef memory leaks (this time really ;-))