Prevent use of an invalid index in NPC AI code.
Thanks jkaessens for providing the backtrace that enabled solving it.
Also check for no item found in use_escape_item().
Merge PR #1204 - fix NPC segfault (in choose_escape_item())