android/utils/host_bitness.c: android_getHostBitness()

This patch moves the host bitness detection code to android/utils/
and also improves it to work properly on Windows, in preparation for
Win64 executables.

+ Ensure 'emulator' launcher uses it.
+ Add basic unit test.

Change-Id: I7d55397efeb749b72c502241c4da4cd16696c082
Merge "android/utils/host_bitness.c: android_getHostBitness()" into idea133
Misc ordering of build rules.

Change-Id: If862617b0cdf9d3f794cba859ef19d35bcf9acfd
Merge "Misc ordering of build rules." into idea133
switch to prebuilts for 32bit (guest) emulators.

Change-Id: Ie23837cfc75db5fd6bbc0f84e4178269de93686b
Merge "switch to prebuilts for 32bit (guest) emulators." into idea133
Fix packaging of emulator hardware ini file.

Change-Id: Icd2978a1148a8166e391f5f80d51d8d71ebc8801
Merge "Fix packaging of emulator hardware ini file." into idea133
prevent set size from going below its init size

The set size is initialized to AREFSET_INIT_SIZE, which is set
to 4. When the set size is decreased below AREFSET_INIT_SIZE, it
is reset to AREFSET_INIT_SIZE to make sure other operations not to
break.

Change-Id: Ifb1e87a69b6ebd4e1d46c94891a66ad5d41f92af
Merge "prevent set size from going below its init size" into idea133
replace refset with std::set and fix crashes

Original implementation of looper->pendingIos with refset could
lead to accessing freed objects and causing crashes. This commit
replaces all the refset with std::set to make it simpler and
also to fix the crashes. In addition, the looper-generic.c is
renamed to be looper-generic.cpp, since it uses std::set and has
to be compiled as C++.

Change-Id: I56d47a5a3c2fa2b75cf9be05fc83e1b8a8b847ed
Merge "replace refset with std::set and fix crashes" into idea133
shutdown socket gracefully with SocketDrainer

Previous implementation does not actually drain socket before
closing it. The new SocketDrainer class will read all the data
from the socket and then close it.

Change-Id: Ia9d47051bdb02ce5b24ebd836df7fdcf51d647fe
Merge "shutdown socket gracefully with SocketDrainer" into idea133