Fix problem with empty stdout/stderr answer for shell magent

Change-Id: I76e2c984bf86aa0df3ec1762df52cb1533ad7665
Closes-Bug: #1322475