Add missing return checks

Closed Andreas Schneider requested to merge cryptomilk/libssh-mirror:master-fix into master

Add missing return checks.