gralloc: Avoid setting out handle before allocate finishes

... otherwise a buffer would be leaked if `mDriver->allocate()`
succeeds but `initializeMetadata()` fails as the error handling
in the multi-buffer `CrosGralloc4Allocate::allocate()` would
fail to `mDriver->release();`.

BUG=b:219757060
TEST=cvd start
TEST=vts -m VtsHalGraphicsMapperV4_0Target

Change-Id: I375da2c959dd9df2667503a040ed1dcbd2aa12b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3501132
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
1 file changed