Some games' implementation of md_hasclreol() poked around in ncurses
internals, which does not work for some ncurses build configuration.
Most games did not actually call md_hasclreol(), so it was removed.
There is a standard terminfo function which can retrieve the value of
the clr_eol capability, so this was used for rogue5.
The function wrapped the standard putchar(), doing nothing beside
discarding the return value. That could cause problems with tputs(),
which expects an int to be returned.
The new function md_random_seed() has replaced time() + getpid() and
similar methods. Putting everything in mdport.c slightly reduces the
warnings and workarounds.
curses.h is already included in rogue.h and doesn't need to be included
twice more in mdport.c.
Also set flags for some features when they are present.
The implementation was copied from rogue4. Using fdopen() is necessary
because the scorefile needs both encread() and encwrite(). For some
reason I have failed to discover, one of them uses FILE *'s and the
other uses file descriptors.
md_shellescape() sets SIGINT and SIGQUIT to be ignored, storing the
previous handlers, and restores them after the shell exits. But it
mixed up the two handlers.
Since the signals were usually handled by the same function, this fix
doesn't have much effect, but anything that makes signal code less
confusing is a good thing.