client: Add and use return check helpers, this makes it easier to see where the error happened.