recovery: Fix adb backup

Using http://goo.gl/6AQ3u might fail. The resulting backup
consists of a tarball of the filesystem being backed up,
but it might end up truncated, for reasons yet unknown.

Issuing adb backup data, for instance, causes recovery to
call tar, streaming it's stdout <a> through a socket <b>.
The adb client reads from <b> and copies what it to the
final backup file.

Somehow, sometimes, not all the content generated at <a> is
read at the adb client, which causes a truncated tar file
to result. I'm unsure why this happens: Doesn't <a> get
flushed before <b> is closed? Or is it that <b> is closed
with outstanding data in its buffers, which never make it
to the other side?

Either calling sync() or sleep() seems to remedy the issue,
but I'm not sure if sync() has any effect on sockets or
pipes. I also understand that sleeping for some time is not
the best solution to a race condition.

Therefore, I'm adding calls to sync() and sleep() and
waiting for reviews from someone who knows better how
these calls work.

Patch set 2: Remove sync() call

Change-Id: If4733066fdad809eb73e87c670f37acc4debe82d
Merge "recovery: Fix adb backup" into cm-10.1