recovery: Provide caching for sideload files

Create a cache of block data received via adb.  The cache size is set
to ensure that there is at least 100mb available for the installer.

When the cache is large enough to hold the entire file, each block is
read via adb at most once.

When the cache is not large enough to hold the entire file, the cache
will need to be pruned.  Because files tend to be read sequentially
during install, the pruning algorithm attempts to discard blocks that
are behind the current file position.

Remove logic to fetch the entire file in favor of the cache.

Change-Id: Id8fc7fa5b38f1d80461eb576b1a1b5d53453cfc1
recovery: Gracefully terminate sideload

 * When the host aborts sideload during verification, the FUSE file is
   mmap()'d and the abort generates a SIGBUS.  Handle this with longjmp
   and return VERIFY_FAILURE.

 * During adb sideload, handle SIGTERM by setting a flag.  This allows
   the sideload thread to terminate gracefully.

 * Note SIGTERM is handled by the main adb thread, so the sideload
   thread does not get an EINTR from read().  Add a select() to ensure
   that the sideload thread can detect the error.

Change-Id: I2287ca2e7178138723c437174970434bfcb3c215
Merge branch 'cm-12.0' of https://github.com/CyanogenMod/android_bootable_recovery into cm-12.0