shell pipe: set exit code to error if any pipe element fails

  * this was causing backup state to be reported good while tar command failed

Change-Id: Iaa9728213bbe44a8a8622e2c0ef1ad9548ccabb7
Merge branch 'xiaolu' into HEAD

Change-Id: I971d587bb58c468b2e2cada202776dac2174bed0
Dedupe: backup & restore selinux contexts.

Change-Id: I1f7168e7df0a2f0a27c3627209739c6385da1935