misc sftp changes

Modified sftp task to only use a single sftp session and to use actual Error objects instead of strings for errors.