Fixes authorized_keys file permissions

Owner and group id are not inherit when calling shutil move. This commit
moves setting permissions logic for the authorized_keys file to be sure
that the final destination file has the proper permissions.