Bugfix for crash caused by buying an item from an NPC

Fixes #883
Fixed bug caused by premature deletion of an item with a scripted onEquip move event when it was sold by an NPC and the appropriate equipment slot was empty.