flash-ap: Create private key file with mode 0600

When flashing AP with 'cros flash-ap -d $IP', we always see the
following warning.

 Permissions 0640 for '/tmp/tmp3qwvzlkg' are too open.

This is because shutil.copy() also copies the file permission 0640 of
testing_rsa. Since tempfile.NamedTemporaryFile() always create a file
with permission 0600, replace shutil.copy() with shutil.copyfile() to
avoid copying file permission of the private ssh key file.

BUG=none
TEST=Ran 'cros flash-ap -d $IP' and didn't see the warning

Change-Id: Icca11d4cdda2eb0595f89d9fd4b15e824150f778
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2346133
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Yu-Ping Wu <yupingso@chromium.org>
Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
diff --git a/lib/firmware/flash_ap.py b/lib/firmware/flash_ap.py
index 24cc07e..142bc6b 100755
--- a/lib/firmware/flash_ap.py
+++ b/lib/firmware/flash_ap.py
@@ -169,7 +169,7 @@
   logging.info('connecting to: %s\n', ip)
   id_filename = '/mnt/host/source/chromite/ssh_keys/testing_rsa'
   tmpfile = tempfile.NamedTemporaryFile()
-  shutil.copy(id_filename, tmpfile.name)
+  shutil.copyfile(id_filename, tmpfile.name)
 
   scp_cmd, flash_cmd = _build_ssh_cmds(futility, ip, port, path, tmpfile.name,
                                        fast, verbose)