+ to TODO.
Add AC_PROG_MKDIR_P.
xterm-keys: fix xterm_keys_match to properly recognize partial matches

In case of a partial match (cases where buf is shorter than
template) the loop was comparing one character too much, ending up
with comparing \0 in buf which would fail.
Fix: change pos++ to ++pos

The incrementation of the template counter has to be done always,
so the conditions in the loop need to be switched.

This problem was probably mostly unnoticed, since usually the whole
sequence is read from the tty in a single buffer.
However for example on Cygwin the buffer is read byte by byte and
the bug surfaced.