Fix inventory_ui bug where worn items would not get dropped

Fixes #7619 and fixes dropping several worn items at once, which was also wrong.

Bonus: use of new coding style.