Fixed error-checking error in sftp.php

Fix for the errors in #5675