Really fix itemdef memory leak
Merge 'upstream/master' into minemovie