CopyFileContents should create dirs if needed

This was preventing the tests from passing when the expected_output dir was not present.