NH4: Replay from diffs if the commands won't sync

Each diff that is reached in the log during a replay is used to
construct the save file as the game was played (mf).  The replay itself
makes its own in-memory save (diff_base) and compares the two.  If they
differ, the replay recovers from the game's version constructed from
diffs before continuing.

Note that this change makes rewinding turns much slower than before.  A
fix exists in NetHack4, but it hasn't been ported yet.

Compared to NetHack4, recovering from save-compared desyncs accounts for
tutorial mode, the diff command/count decoding is simplified slightly
and some extra comments have been added.

Replay from diffs, if the commands won't sync
Alex Smith <ais523@bham.ac.uk>
7990aa24b1f190f60543b3e845b2774f64187a39
NH4: Fix replays with broken command data

Also, count replays by diffs (~) instead of commands (>).

This is meant to go with commit cd1d97bb6f (NH4: replay from diffs if
the commands won't sync).

Make log replay count by ~ not >, fix replay of logs with broken command
data
Alex Smith <ais523@bham.ac.uk>
7d748339f938cc3e814da31a1b2b5ea3468c8cee
NH4: Display prompt selections in message history

Responses to menus, questions and prompts are now recorded in the
message log, and shown in message window if they wouldn't block other
messages with --More--.

Display menu/question/prompt selections in message history
Alex Smith <ais523@bham.ac.uk>
58295ae9c592d37b87928a24c0fa7c002a9f2b46

NetHack4 bugfix: id is not always the same as accel in object menus
Alex Smith <ais523@bham.ac.uk>
9874b0dfe6a3f91a0f87caea7d2a8e4ef4ba5f1e
NH4: Initialize diff logging correctly

This is meant to go with commit 86bb075297 (NH4: store game state diffs
in logs and save files).

This was extracted from the following NetHack4 commit:

Add messages to log, show them when replaying from diffs
Alex Smith <ais523@bham.ac.uk>
5c1eaef25838605ce3340ce3f760087074b4f3a4
NH4: Log messages, show when replaying from diffs

There's a fair amount of code in the NetHack4 version of this commit
that actually belong with other, previous commits.  This version only
contains what's needed for this feature to work.  Since messages aren't
logged during multi-turn actions or occupations, messages beyond the
last 30 may be left out, which is a minor problem.

Add messages to log, show them when replaying from diffs
Alex Smith <ais523@bham.ac.uk>
5c1eaef25838605ce3340ce3f760087074b4f3a4