Fix fileutil.CopyFile close semantics and error propagation
#31164
+92
−10
fileutil.CopyFile close semantics and error propagation
#31164