Fix for duplication bug.

It was possible to get the item in a phantom slot with the new inventory
management features. This prevents for example the item double click
feature (make stack) to take items from the ghosted inventory.