Decode stdout in shell.run_cmd

Closes #885