Fix inventory item filtering (use id, not index).

Prior to commit 72a955c770dea50729c65cd77658501b4e1fe451, in
`lua/gui/inventory.lua`, the index of an inventory item in
`inv_list_data` corresponded to the number of a `[item]` in `var`, such
that `lp8.get_child(var, "item", i)`, where `i` is the index of an item
in `inv_list_data`, would return the corresponding source `[item]` from
`var`.

Commit 72a955c770dea50729c65cd77658501b4e1fe451 broke this underlying
assumption by (a) adding the unit’s `[attack]`s to `inv_list_data` as if
they were items, and (b) sorting `inv_list_data`.

I corrected this discrepancy by filtering on an item’s id rather than
effectively filtering on its index.

For the record, I am assuming that (a) the id of an item in
`inv_list_data` is equal to the id of the corresponding source `[item]`
in `var`, and (b) an item’s id is unique.

While it is possible that a future commit may break these assumptions as
commit 72a955c770dea50729c65cd77658501b4e1fe451 broke the assumption that
the index of an item in `inv_list_data` equals the index of the
corresponding source `[item]` in `var`, the invalidation of these
assumptions would be indicative of a deeper problem, a problem with the
assumption-breaking commit rather than with the assumptions broken, a
problem that would justify the reversion of the assumption-breaking
commit, so I am not concerned by this contingency.

This should resolve #2 in the GitHub issue tracker
[https://github.com/Vultraz/NX-RPG/issues/2].