Fix map::i_stacked unexpectedly changing items.

Previously the function would add up the item count in the item::charges member of one of the supplied items.
This was only relevant for items counted by charges, and those should only appear once so no harm was done.

Remove adjusting the item::item_counter member, because the item shall not be modified here.
Astyle item::stacks_with and constifiy it and the parameter.
Make items::stacks_with clearer.

Remove the pointless variable stacks, instead return early as soon as something that prevents stacking has been found.

Remove the duplicated check for contents.size()

Add check for same rot-value for items that rot.
Use item::count_by_charges instead of manual testing.
Merge items (counted by charges) only when they stack.

Previously they would merge when the item type was the same. This would discard all the properties of one of them.
Now they only merge when they can stack (all their meaningful properties are the same).

Extract logic to merge item by charge into item function.