Allow clients of mapMemory to recover.

Before, memory could only be nullptr if a mapper instance returned
nullptr. However, sometimes this method would abort. This is
problematic, for instance, when unknown code sends an instance
of hidl_memory to another process. You are forced to manually
write the contents of this mapMemory method with the proper
error handling or to risk your process being aborted. Since this
method already returns nullptr sometimes, and the default usecase
is to pass things into this method which are from another process,
allowing users of this method to handle errors manually will
close a whole class of errors.

Test: (sanity) hidl_test, internal device boots
Fixes: 38377981

Change-Id: Ida6e73b224da34175746e86a08f545ef6db92293
2 files changed