Fix test and expose status code

1) Fixes the chown test to avoid permission error.
2) Adds a function for gosftp to retrieve the sftp error code, and also exports the error code `OK`.