[sftp] simplify isDir handling
- new macro KSFTP_ISDIR akin to S_ISDIR checks if a given attributes is a directory
- ternary mutate dir||file error
this has the advantagous side effect of all commands now having an error()
or finished() call at the function end making it clear that we always
finished somehow