Finish implementation of "cmd".

Now wait for result to come back and return it, and
do some error checking and reporting for the IPC.

Test: manual.
Change-Id: Id8deb6cb3a363d0718af9e8faf2da4879ff6d27e
1 file changed