gralloc: Return an error if the buffer was not mapped

(Second attempt at this change)

In some cases, the framework attempts to lock a secure buffer.
Since it does not get an error code from the lock, it proceeds to
dereference the base address (which is invalid). Return an error
code when a secure buffer is attempted to be locked, while still
ensuring that the metadata is mapped.

Bug: 28526999
Bug: 30404840
Change-Id: I6e2aaa8e9d2f28b5f5ae98fcb449d58c2f728f52
CRs-fixed: 1010697
1 file changed