Normalize negative nanosecond values in stat_struct_to_py()

 * Adds normalize_stat_time() to handle normalization

Turn sane negative nanosecond values (where negative nanoseconds simply
subtract from the seconds value to give the correct time) into the
equivalent positive nanoseconds time values.

This allows systems which use them (such as Cygwin) to report correct
timestamps to bup. Systems which return garbage or values > 1e+9 will
still (correctly) be identified and fail testing.

Signed-off-by: Will Rouesnel <w.rouesnel@gmail.com>
Set BUP_MAIN_EXE and BUP_DIR in testpacks()

testpacks did not set the BUP_MAIN_EXE and BUP_DIR environment variables
before invoking git.PackWriter(), which caused the wvtest to be run
looking for the wrong files.

This is currently Cygwin-specific problem, but the all other tests in this
series set these environment variables before running any other logic,
but for a currently unknown reason the environment does not appear to be
preserved properly under cygwin. With this change, this test executes
successfully while still being a correct test.

Signed-off-by: Will Rouesnel <w.rouesnel@gmail.com>
Procedurally generate t/sampledata

  * Remove existing sampledata from t/
  * Initial check-in of generate-test-data.sh script.
  * Add make testdata dependency to the make runtests target.
  * Remove testdata when running make clean.
  * Add t/sampledata and t/testfile1, t/testfile2 to .gitignore.

  * Fixes symlink tests in tindex.py not working on Cygwin.

Storing the sample data for tests in the Git repository causes problems
with cross-platform use due to the differing handling of symlinks by Git,
and the very different behavior that can arise when using symlinks to
files and symlinks to directories. This is particularly a problem on
Cygwin.

This commit resolves this problem by replacing the fixed sample data with
a shell script (generate-test-data.sh) which dynamically creates suitable
test data before tests are run.

Signed-off-by: Will Rouesnel <w.rouesnel@gmail.com>