Use FdFile::Copy() in dex2oat for better error checking.

Previously, read errors would have been silently ignored
and write errors would ungracefully crash.

Also improves performance on Linux, including Android,
by using sendfile(). (We still keep Mac builds around.)

Test: m test-art-host
Change-Id: I689e8b9fee4595c42b353bd10042b60a7d6c1bc7
1 file changed