CS747,748,765,768,815: Autoexplore from NetHack4

Actually, this commit is a port of autoexplore by Alex Smith from
NetHack4 rather than UnNetHack, but includes the following from
UnNetHack anyway:

 * mem_stepped in struct rm cleared in clear_memory_glyph().
 * Helpful comments in a handful of places.

I've done my best to map the UnNetHack changeset numbers to the NetHack4
code changes.  Also, NitroHack already includes the TEST_TRAP mode for
test_move().

Porting notes for each individual commit below:

https://gitorious.org/nitrohack/ais523/commit/5f2e2418643c39f5d9e0a1fe38689cd3e745d3a8
"A start of an autoexplore implementation"

 * Fixes doautoexplore() to return the first call to domove(), like I
   did with dotravel().
 * lflags2 in save_location() and restore_location() is now a 32-bit
   integer, up from a 16-bit short, since the Sokoban flag memory bit
   takes up the spare bit.  This changes the binary save format.
 * Fixes initialization of water_pos in movebubbles() in src/mkmaze.c.
 * nomul(0, "") replaced with nomul(0, NULL).

https://gitorious.org/nitrohack/ais523/commit/f52e890a5a2594e00199ed9434c3852ff45f0711
"Various autoexplore and travel fixes"

 * NetHack4 stops and returns 0 from domove() when travel/autoexplore
   is blocked, which replaces part of an earlier, similar fix I made to
   stop spending an extra turn in such a case on the first step.
   However, it doesn't have the fix to command_input() that prevents an
   extra turn being spent in a subsequent step.
 * Adds level argument to calls to is_safepet(), canseemon() and
   canspotmon() due to the worm_known() segfault fix I made quite a
   while ago in commit fd571a1f9aa68e182a2266a5798e9dd35d01f882 (remove
   sp lev hack, fix resulting level segfaults).

https://gitorious.org/nitrohack/ais523/commit/616a276f4d82f6d24e4a522adc251428c072ca0c
"Autoexplore improvements from UnNetHack"

 * Removes unused 'mode' argument from autoexplore_msg().

https://gitorious.org/nitrohack/ais523/commit/d1d221db06f3b36dd13a2ec92d47ef6da5aa6f6d
"Improve autoexplore in difficult terrain"

 * Omitted change that suppresses a message in a feature that only
   exists in NetHack4 that stops players walking into hazardous terrain.
Clear mem_obj_soko when needed in display.c

Oops, forgot this somehow.  This is what I get for forgetting to use
cscope.

This is meant to go with commit 662a119c70 (CS715 color Sokoban prizes
bright magenta).
CS766: Autoexplore: enable for amnesia'd levels

Without this, autoexplore will claim that it's done when revisiting an
amnesia-afflicted level that was completely autoexplored before the
amnesia.
Clear new mem_obj bits when forgetting map

Specifically, this clears the bits for a pile of multiple stacks of
objects, and whether the object is a Sokoban prize when a map is cleared
by amnesia.

This is meant to go with commit 662a119c70 (CS715 color Sokoban prizes
bright magenta) and commit 644c88b3e7 (CS377,513 multiple items on floor
in inverse video).
CS767,775: Tell player if they're done exploring

This sniffs out unexplored non-corridor spaces on the level and hints to
the player that they exist if autoexplore can no longer proceed.
CS905: Autoexplore:don't ignore Black Market items
CS906: Autoexplore: prefer exploring items

Now autoexplore won't just zip past items when the player sees them and
decide to come back to them at the other side of the level.

This uses INT_MAX from limits.h, and I have no idea which C standard
either is meant to be from.  Compiles and runs fine here, so I hope it
won't matter.

Compared to UnNetHack, autoexploring is a boolean instead of an int
masquerading as a boolean.
CS907: Autoexplore: interrupt when entering a shop

Also a bit of a code cleanup in unexplored(), since it's changed anyway.
Autoexplore: Fix obstruction msg for traps

This moves the autoexplore obstruction message from test_move() to
do_move(), otherwise players will never see the message "A trap blocks
your way" when autotravel is blocked by a trap.

This bug also exists in NetHack4.
Fix paranoid_trap prompt suppression when running

This broke when the paranoid_trap check was moved down, since there was
code in between that called nomul(0, NULL), which nuked all signs that
the player was ever running, leading to the prompt appearing when the
player ran into a trap using Shift+direction.

This is meant to go with commit 719c74a709 (CS704 move paranoid_trap
check after attack check).