Verify that the elf matches the expected arch.

To avoid a case where a malicious app might try and trick the system to
create an elf and register object that mismatches, always verify that they
are the same arch.

Test: Ran unit tests.
Change-Id: I66978e9e02f8e4f396856912e7019528ead4838e
19 files changed