sftp: Implement GFileCreateFlags and improve permission handling

Set the file permissions to 0600 when G_FILE_CREATE_PRIVATE is
specified and the file does not exist or
G_FILE_CREATE_REPLACE_DESTINATION is specified.
Otherwise, set the file permissions and ownership to the permissions and
ownership of the existing file only if it is a regular file (i.e. don't
set the permissions to 777 because the existing destination is actually
is a symlink).
Otherwise, use the default file permissions by not setting any file
permissions.

If G_FILE_CREATE_REPLACE_DESTINATION is specified or the destination is
a regular file, write to a tempfile and rename; otherwise, replace by
truncating the destination.

https://bugzilla.gnome.org/show_bug.cgi?id=710906