cros deploy: create a PORTAGE_TMPDIR directory on stateful partition

The current PORTAGE_TMPDIR is set to /tmp, where the available space
is not sufficient for some packages. This CL creates a temporary
directory on the stateful partition and set PORTAGE_TMPDIR to it. It
also cleans up the directory and the binary package after each package
is installed to free up the space for other packages.

BUG=chromium:343672
TEST=`cros deploy device_ip gtalk`

Change-Id: I559e62e1f64630d8485f36038cbf2bdd37f020bd
Previous-Reviewed-on: https://chromium-review.googlesource.com/186844
(cherry picked from commit 1b4a7c9ffbf483fff8275a163b6e3e988563f362)
Reviewed-on: https://chromium-review.googlesource.com/188003
Reviewed-by: Yu-Ju Hong <yjhong@chromium.org>
Tested-by: Yu-Ju Hong <yjhong@chromium.org>
3 files changed