Move idmap to frameworks/base [2/2]

idmap depends on libandroidfw, so it should go in frameworks/base.
This follows AOSP which moved idmap to frameworks/base back in
February of 2014.

Change-Id: Ice308a5299a69fd1fbc084a7c76a317c7dec3689
Fix an overflow found by ASAN.

Sometimes len is 0.

Change-Id: I031000188edc57663a5519b00cbbb751600d32f4