client: avoid possible NULL deref on error path