Replaced truncate() call with boost::filesystem::resize_file().

This is available on Windows, whereas truncate is not.
Merge pull request #376 from johnhaddon/msvcFixes

Replaced truncate() call with boost::filesystem::resize_file().