api: client: cli: simplify toStatusError calls

This patch just makes the type assertion checking for StatusErrors
occur inside toStatusError.

Docker-DCO-1.1-Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)