Implemented colored output for win32.

ANSI escapes are parsed out in compat/win32/printf.c and color commands
are redirected to console API. Also due to using console API directly this
fix greatly improves console output speed of tup - previously printing
thousands of lines was slowing down tup greatly on win32 (i.e. initial
directory scanning was noticeable slow when tup was not redirected to a file).
fixed broken redirection to a file.
Fix Cygwin crash after injecting hook library.

It looks like Cygwin gets confused by receiving DllMain THREAD_ATTACH
notification when the library is not yet initialized causing it
to later crash. This can be easily reproduced by modifying tup-dllinject
to just CreateRemoteThread which does nothing.

Proposed fix changes injection method from remote thread to code cave
(write stub, adjust eip, resume). This method is safer in overall
because have no side effects of THREAD_ATTACH notification on loaded
libraries.
Fixed fopen with "rb+" mode was always considered as write operation

by hook even if file does not exist and open fails.
Some MingW gcc builds are trying to open some kind of database files
this way (.gcda code coverage?) near output files.
Fixed win32 API hooks were not preserving GetLastError() value
causing applications to get confused on errors.

For example in my scenario MingW was trying to get information regarding
include folders, but was using buffers which are too small to fit all
information, win32 API was reporting this, but error code was lost in
hook, causing MingW to think that API call failed due to unknown failure
instead of retrying call with bigger buffer.
Fixed get_relative_dir() was using POSIX path separators when generating
relative directory string on win32.

Windows shell (cmd.exe) in most cases treats slashes as start of command
parameters, thus making get_relative_dir()-derived paths unusable for
usage in shell scripts on win32.
Merge remote branch 'forester/win32_colors'
Code formatting fixes.
options: Remove DEFAULT_COLOR define.

This was used to differentiate between Windows/other OS defaults, but now they all use "auto".
win32: Fix database backups.

It seems SQLite is locking the .tup/db file, so when we go to back it up, Windows is unable to open the file. This commits & closes out the database before backing it up, then re-opens and begins a new transaction before going through the database upgrade logic.
win32: Make sure backup db is opened in binary mode.

In Windows, we wrap open() with our own implementation that goes through CreateFile, which doesn't do the newline conversion that open() normally does. However, we don't wrap creat(), so this was causing the backup database to be malformed. If we just use open instead of creat, then we go through the CreateFile route and can backup the database correctly.
Fix t2103, t2108 for new Windows paths.
win32: No longer need to force MinGW binaries, since Cygwin works.
win32: Remove tup-cp

Both Cygwin cp and Msys cp work now, so we don't need a wrapper version in tup.
added &-variables to the man page, and renamed t8067
added t2124 and t2125 - ensure node variables can't refer to files outside the .tup root
updated todo (node vars)
Skip over variant root tents when getting the relative path between two tents.

This fixes node variables refering to generated files in variants, without needed to store paths in the node variables themselves.
added t8068 - node-var including a Tupfile, that references a generated file (variants)