applypatch changes for patching recovery image

Make some changes needed to applypatch in order to store the recovery
image in the system partition as a binary patch relative to the boot
image:

  - make applypatch use shared libraries, so it's smaller.  It will
    need to be on the main system so it can install the recovery
    image.  Make an applypatch_static binary for use in recovery
    packages (still needed for updating cupcake devices to donut).

  - output the results of patching to an in-memory buffer and write
    that to the partition; there's no convenient /tmp for us to us.
    (This should be basically a no-op in recovery, since /tmp is a
    ramdisk anyway.)
diff --git a/core/Makefile b/core/Makefile
index 107d0c1..fa2d124 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -788,6 +788,7 @@
 
 built_ota_tools := \
 	$(call intermediates-dir-for,EXECUTABLES,applypatch)/applypatch \
+	$(call intermediates-dir-for,EXECUTABLES,applypatch_static)/applypatch_static \
 	$(call intermediates-dir-for,EXECUTABLES,check_prereq)/check_prereq \
 	$(call intermediates-dir-for,EXECUTABLES,updater)/updater
 $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_OTA_TOOLS := $(built_ota_tools)