sftp: Fix detection of empty permissions
Commit 04e710b6 removed the check for mode < 0, but that is exactly what is fed to ::copy() and ::put() by their callers.
Re-add the check and make the mode variable an int so a negative value doesn't get lost.
This fixes the issue that new files are created with 7777 permissions. Probably bug https://bugs.kde.org/show_bug.cgi?id=498888
As a bonus, log permissions in octal instead of decimal.
Edited by Méven Car