Move half of a special case to a better place.

The remainder should be fixed with the dungeon rewrite by allowing the level to
influence created objects.
Update aimake
Merge remote-tracking branch 'dtsund/savebreak' into savebreak
Don't panic on resizing floating objects

This happens when, for instance, wishing for an artifact (because the
artifact is floating before it gets the name, and has to be resized
to make room for its name). Fixes #415.
Merge remote-tracking branch 'dtsund/savebreak' into savebreak
Some adjustments to the ':'/'^G' split

In particular, it is now '^G' not 'M-G'.
Changelog for ':'/'^G' split
Fix reversed test in the ':'/'^G' code

It was consuming time if and only if it shouldn't.
Changelog fixes
Merge remote-tracking branch 'dtsund/savebreak' into savebreak
Update aimake

This fixes a couple of bugs that were causing more files to be
rebuilt than should have been; after the fix, dirty builds are
now substantially faster if only small changes have been made to
files.
Teach the save code about the existence of EINTR
Update comments in log.c to be more informative and/or more accurate
Don't leak memory in log_desync() calls
A start on implementing save file recovery

Currently this only runs in response to a save file that has been
truncated to a position midway through a line.
BUFSZ purge, part 1: messages

Wow, I haven't done a change this big in a while. Executive summary:
we no longer use fixed-size buffers for strings shown to the user,
instead the strings are stored in turnstate and freed when we drop
back to the main loop.

The hardest part of this change wasn't making it, but rather ensuring
I didn't make mistakes (given how many source files I touched). I
can't guarantee that this is 100% bug-free; however, to make it much
more likely, I made the entirety of libnethack const-correct
(apart from two lines in options.c, because options are currently
broken-ish). libnethack, tilesets, and libuncursed now compile
correctly with -Wwrite-strings and -Wcast-qual, which between them
statically guarantee that no string literal will ever be overwritten,
and no immutable message will ever be overwritten (barring dubious
tricks like untainting them using the return value of strcat). Along
with -Wformat-nonliteral (which libnethack doesn't compile cleanly
with, but was nonetheless useful despite the false positives for
catching cases where I'd called msgprintf with sprintf's calling
convention), this should catch the majority of mistakes in converting
string uses over.

Most string uses are simply ported directly over to the new API,
which is very similar to the old one. Occasionally, functions were
rewritten because it was easier than porting them; the most notable
such function is makeplural(), which uses the same algorithm but I
got rid of the code duplication (and fixed a few pluralizations in
the process).

Not done in this commit: checking the codebase with -Wunused-result
and appropriate attributes in order to catch cases where I've called
msgcat with strcat's convention. There's probably at least one,
although it's somewhere obscure enough that it doesn't turn up in
basic testing.

Currently broken: memory management properties for options,
character selection. I think these were all broken beforehand, but
it becomes glaringly obvious when you try to make them const-correct.
These cause numerous -Wcast-qual warnings, and even some assigned-
to-a-const-field warnings, which are not fixed in this commit.

There's also a memory leak in init_game_paths, which this commit
does not fix (although it does make it much more obvious, as a
result of const-correcting it).

This commit also adds spurious blank lines to the end of many header
files, which I will hopefully remove in a future commit. The reason
is that I accidentally reverted these changes rather than committing
them (a mistake VCSes don't protect you against!), and recovered them
from aimake's isolation directories. The extra blank lines are a
somewhat bizarre and inexplicable side effect of my recovery method.
Normally I'd leave them out of the commit, but after almost losing
this much work once, I'd rather just commit everything at once and
make sure it's in the VCS history.
Avoid an infinite loop recovering a game that crashes during disclose

This isn't a perfect fix: all writing to a file should attempt to
read from it first, and this doesn't, thus the infinite loop could
still occur given a malicious save file or an engine incompatbility
in which the player dies in one game and not in the other. Still,
it's a one-line fix that doesn't hurt anything and has another
positive side effect (loading a game that's already ended now loads
it at the start of the disclose, rather than attempting to replay the
disclose sequence, meaning you get to see the DYWYPI again, which is
entirely reasonable behaviour for loading an ended game in "play"
rather than "replay" mode).
Fix HP check for eating acidic corpses
Fix typo in messages when buying from an angry shk
Rewrite realtime handling

Realtime is now handled in a log-safe way; additionally, the log
contains timestamps for all user input, making it possible to
play back a replay in realtime if we want (or write something like a
log to ttyrec or log to video converter).

Currently, night, moonphase, etc. are updated at the end of each
command, rather than at each user input. The latter is also possible
with this codebase, but leads to some strange timing problems (e.g.
if it changes mid-turn, when do you print the message?)

Moonphase and Friday 13th have't been tested (because it isn't a
weird moon or a Friday 13th today on 6 April 2014).

This also exposed a really insidious bug in memfile.c, fixed in this
patch. I'm glad I decided to use subsecond accuracy, or it might not
have been noticed for another 24 years :-)