Fixed subprocess error reporting

Moved stdout and stderr decoding to earlier stage to prevent
decode error.

Note, the code is not py3 compatible. But this change doesn't
introduce any new incompatibility, it changes order of existing
decode calls.

Change-Id: I23f7340e254ec249f00c6de9a980adac9e637983
Closes-Bug: #1399490
Merge "Fixed subprocess error reporting"