Avoid a crash on ctrl-x after a trap escape.

When a monster escaped a net, the stash tracker only updated the net
(to non-trapping) if the net was on top.  Otherwise, the stash was
incorrect, causing a crash on ctrl-x and probably other situations.

Also fix up a few incorrect comments.

An example crash:
  http://dobrazupa.org/morgue/MrPlanck/crash-MrPlanck-20140825-203617.txt

(cherry picked from commit d5b6136a9e5e93ad0e92da558a7172758dbcaa31)
Fix new headers in the MSVC project (doy)

Some were tagged as ClCompile rather than ClInclude, and one had the wrong
filename entirely.

(cherry picked from commit 79e486ca10e493bfe10dd0cf12c7a34e61b1e71f)
Fix F_OK in MSVC compilation.

(cherry picked from commit 8122c7630447c911c4916ba98f14fc4e47d68329)
Use "||" instead of "or".

MSVC requires either /Za (strict ANSI mode) or #include <iso646> for
these aliases.  It's weird anyway to mix them with || on the same line:
unlike in Perl, there is no difference in precedence.

(cherry picked from commit 8501abf23fc13fab4aca103ac51532abc4eaf181)
Work around an MSVC template bug.

It thinks the second version of compare_item is an attempt to specialise
the first version, rather than an overload; and then complains about the
bad specialisation.  Rename the function-pointer version of the template.

(cherry picked from commit f9b15c953acf447f35e322015c76ca2af8444997)