Prevent items being equipped to wrong slots when no slot is available

When item ids are the same, we need to make sure that source quantity
+ destination quantity does not exceed the max quantity for that item.
Otherwise, ItemStorage::add() will try to place leftover quantity in the
first empty equipment slot, regardless of type.

Closes #1137
Merge pull request #1154 from dorkster/fixes

Prevent items being equipped to wrong slots when no slot is available