Don't allow running/travel when stunned/confused

Autoexplore already does this, but the code for it is now bundled with
this fix.

While we're at it, ensure flags.run is set to 0 when movement is blocked
in command_input() and when occupations are stopped or finished by
unmul().  Otherwise, normal movement could be stopped by stunning or
confusion when it shouldn't be.

This is related to commit a7f6b941a5 (interrupt running/travel/
autoexplore when confused).

This bug also exists in upstream NitroHack.

Fixes #83 on GitHub.
CS1480,1539: Enhance paranoid_water, include swamp

paranoid_water now stops the player from walking into muddy swamps as
well as water.

paranoid_water and paranoid_lava only warn if you're not already over
the terrain in question.
CS1353: autounlock when #looting locked containers

If a container is found to be locked when trying to open it and a
suitable unlocking tool is found, ask to unlock it.  Originally from
UnNetHackPlus.

The #loot command still needs to be used again to actually open the
container; ideally this would happen after the container is successfully
unlocked.

Compared to UnNetHack, answering 'y' to picking the container's lock
doesn't ask to loot to other containers on the same space.
Fix replay hiccup from port of autounlocking doors

The variable dz in pick_lock() is left uninitialized if non-zero rx and
ry arguments are given to the function which, when checked later in the
function, leads to desync between a game and its replay.

This is meant to go with commit ff361dbf02 (CS884 ask to unlock when
opening locked doors).
Init/save/restore resumable occupation state

Setting traps, removing armor and unlocking containers now clear, save
and restore their state between games played in the same process, so
they can be reproduced in replays without causing desync errors.

The code for saving the state for unlocking containers is messier than
that of, say, setting traps because of the risk of dangling pointers,
which trap-setting avoids by always zeroing pointers after itself.

This bug also exists in upstream NitroHack.
Autounlock #loots containers after unlocking

When the player chooses to autounlock a container when looting, the
looting menu will be shown once the container has been successfully
unlocked.  At long last, this makes locked containers as easy to loot as
unlocked ones; it's even better with NetHack4's 'a,' #loot shortcut.

Credit to Bulwersator for the idea.