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

This is available on Windows, whereas truncate is not.