cmd/run: Fix cmd wait

It was supposed to check cmd insetad of err to decide to wait for the
cmd or not.

Signed-off-by: Asias He <asias@cloudius-systems.com>