shell: Put last 7 lines from redirected output to debug log

Really convenient when you run in verbose mode and want to see
why command failed.

Change-Id: Ia123a347796309caa92c141e97b048bae915679f
Merge "shell: Put last 7 lines from redirected output to debug log"