Fix dropping all of a stack of ammo/meds via advanced inventory

Fixes an issue in the inventory code that would leave 0-charge ammo in your inventory sometimes (as noticed during the implementation of #634).