libcopybit: Fix potential memory and surface leaks in c2d

- Check MAX_SURFACES while mapping GPU addr
 --- While mapping gpu address, first check if the request
     is less than the MAX_SURFACES allowed.
 --- Without this check, when the request exceeded MAX_SURFACES,
     there was memory leak as that gpu addr was not unmapped
- Map the destination surface only once
 --- The destination surface for the c2d blit will be the
     FRAME_BUFFER_TARGET per transaction
 --- Map this only once from the copybit_clear which is the first
     call by hwc for a transaction
- Increase MAX_RGB_SURFACES to 12
 --- To handle use cases where there are more than 8 RGB layers

Change-Id: Iffacde30ee88b9c21d0895cb1922aa981bb079e9
CRs-fixed: 475327
1 file changed