Remove used-up items based on item pointer instead of position.

There's a possibility that item position shifted due to other items being consumed by the iuse method.
In particular activating a turret triggered it pretty reliably since it consumed some ammo at the same time.
ianestrachan found the problem, but his fix in PR #5301 missed the corner case where the used/consumed item was wielded.
A little random cleanup also included.