Check that the testprogram compiled before we test the result from running the test. This fixes error when running cmake on Windows.
Merge pull request #317 from perroe/fix_time_test_windows

Fix - cmake failure on Windows - check time_t.