fix fread buffer has no terminating null string

do not allocate memory where it is not needed

Change-Id: I8ab4f7d36173c59aa74a590581a0f7027b7d8a69
use different USB PIDs for adb and adb+ums modes

Commit ad054c684524962eae3269c1d807dc60e8bca1ec made it so that
the same VID/PID pair was used for both adb and composite adb+ums
modes, which prevents the installation of drivers in Windows so that
either mode can be supported.

This uses the original VID/PID pair (18d1/d001) for adb+ums and
uses 18d1/d002 for adb.

Change-Id: I190c821995b7fe9e8177354aec70bd02c114d122
use correct USB PID for adb and new PID for adb+ums

The previous commit assumed that the correct PID for adb+ums
was 18d1/d001. That is incorrect. That VID/PID pair is widely
used for non-composite adb function in recovery. Since there is
no "generic Android" VID/PID allocated for adb+ums, we will
"unofficially reserve" an unused one for that purpose: 18d1/d003.

Change-Id: I6ae095569186c1e854f10b803f786d8c1ae7fb93
recovery: Compatibility with upstream minui change

 * minui is changing a lot upstream. We won't merge it here, but
   it's being used in another branch. Add compatibility in CWM
   so that we can move forward.

Change-Id: I8a3289df2d7bc569229b7212c22adb90d4e76ffd
Make legacy prop environment available to recovery

Google changed the in-memory format for storing properties in 4.4.
Zips containing an older update-binary expect the old format, otherwise
assertions on properties in the update script fail.

This is just enough of the old property service to copy the properties
to the legacy format before running the updater.

Note: this commit is amended by mdmower from the original version by
_that to only provide the prop system. Edits to install.c are done in a
separate commit from scratch to maintain apache2 licensing in this repo.

Change-Id: I1fa9f96fa7a62c7eaba852e4d62e793cd6818907
Use legacy property environment if old update-binary

Instead of falling back to a provided binary when an installation
package contains an incompatible update-binary, set a legacy property
environment. This should increase compatibility with older update
packages while still using the new property system for supported
installation packages.

Method of setting prop environment based on cyanogen's commit:
"Set ANDROID_PROPERTY_WORKSPACE in exec." Tip to rename
/dev/__properties__ so that the legacy property workspace is actually
used comes from conversation with _that.

Change-Id: I5268f67537ad03c077fa05cbb98dfd4da194ffb8
Revert "Add a copy of the updater binary to the recovery resources"

No longer necessary when a legacy property environment is available.

This reverts commit 1153ae5ad9a25198e4edfa7ff9b0bce7f9d40220.

Change-Id: I9726f45d896eb3e14b80e2ddf1df5e6acea83323