Do not reference possibly-freed object after free.

Fixes #437.
Clean up a little bit of save/restore code.

Now 13% more platform-compatible.
Document options memory management properties.
Don't show global variable warnings by default
Un-bitrot the network server

The server code had stopped working due to changes in the surrounding
code; some of it was simple oversights, some of it was code not
updated to new APIs, some of it was unimplemented code.

Currently broken:
- Server cancels don't work in network play on ASCII (this is almost
  certainly a libuncursed issue, because they work fine on tiles);
  they arrive late (which makes saving the game somewhat awkward).
- The string options with default value "" are becoming unexpectedly
  NULL; the code currently contains a workaround for this issue, but
  it's unclear how it came about in the first place, and should be
  fixed at the source
- The server currently relies on the client not sending more than one
  message in the same network packet (an assumption which is mostly
  true in practice; the only violation would be a hangup immediately
  after replying to a prompt). The NitroHack code also had the same
  assumption in the opposite direction, but that assumption has been
  removed (it's untenable, two server cancels in the same packet are
  entirely plausible and happen frequently in testing).
- Options are broken in connection-only mode; UI options are fine,
  but AFAICT the game options aren't saved anywhere, with both client
  and server trying to load them from each other
Get server cancels working for ASCII network play

This was just a simple oversight.
If the socket is closed as a result of a connection failure, stop using it

This was causing a buffer underflow (caught by glibc); the bug is
that a connection error would be detected, some connection errors
would close the socket, and then the connection error handler would
first try to restart the existing socket before moving onto a new
one. The existing socket didn't exist, however, and calling select(2)
on a negative filehandle underflows memory (luckily, something that
is caught by glibc nowadays).
Fix pet vs. monster AI, and change the AC calculations

The main change here is that all monster vs. monster combat now goes
via mm_aggression (or should do, at least). This means that hostile
monsters will not intentionally target pets that wouldn't attack them
(short of conflict), among other things. Pets on below 1/3 max HP
will not get involved in combat, and stray attacks on them in such a
state will get a -100% hit chance modifier (just in case). There is
no longer AC scaling for fights involving partially wounded pets,
because it was generally agreed that although the gameplay was
reasonable, it was also both spammy and unrealistic.

The largest gameplay departure from vanilla here is that pets will no
longer attack peacefuls (actually, in 3.4.3, they attack monsters
indiscriminately, because although mm_aggression is called, its
return value is ignored; there's a separate group of sanity checks to
prevent tame monsters attacking each other, which have now been moved
to mm_aggression along with everything else).

Probably the largest visible departure from vanilla now is that pets
will no longer attack peaceful monsters, without some specific grudge
(e.g. tame dogs will attack peaceful cats, but not peaceful bats).
This makes it somewhat harder to kill shopkeepers; you're going to
have to anger them first. One smaller departure is that pets are
less willing to attack things above their difficulty range while
injured; this should reduce or eliminate the chance of pets killing
themselves on a watch captain (beyond the fact that they will no
longer attack a peaceful Watch).

Each of these behaviours is now very easy to change; for instance, we
could make pets attack peacefuls indiscriminately with two lines of
code, if that's seen as desirable.

My favourite thing about this bug is that I can (very indirectly) lay
the blame on dpeg.

Fixes #172.
Warning fixes

Both were for actual bugs.
Fix save desyncs due to hallucination

Fixes #387. Zero-time commands now will not affect player memory
while hallucinating; rather, they read from player memory (so if you
hallucinate that a square contains a food ration, farlook will tell
you it's a food ration, regardless of what item is actually there).
This means that hallu objects and traps never appear (not that those
exist anyway); sorry b_jonas. Hallu monsters work as in 4.2, because
as those aren't in hero memory, there's no way to incorrectly
overwrite the hero memory.

Hallu objects still change from turn to turn, but this is now in a
"player took time" codepath to avoid issues with zero-turn actions.
This particular behviour is easy to change.

Hallu monsters have been given an API consistent with that of hallu
objects and hallu traps, even though they behave differently, to
futureproof against future changes.
Support retrieving tile dimensions in libuncursed

Currently untested.
Merge remote-tracking branch 'coppro/savebreak' into savebreak

Conflicts:
	libnethack/src/muse.c
	nethack/src/options.c
Merge remote-tracking branch 'dtsund/savebreak' into savebreak

Conflicts:
	nethack/include/nhcurses.h
A bunch of trivial warning fixes.

A number of the uninitializeds were false positives, but I've initialized things
to NULL anyway so that if they do fail, they fail horribly.
Fix a const string escaping as dynamically allocated memory.
Ensure disintegration wipes out objects.

Previously, a resistant monster would have their inventory protected.
Record the start/end time in seconds as well as microseconds

Let's not break the Junethack parser.
Merge branch 'savebreak' of git://gitorious.org/nitrohack/scshunt into savebreak
Stop update_showlines from mangling whitespace in some corner cases.