vulkan/screenshot-layer: Fix memory leak in writePNG function
What does this MR do and why?
vulkan/screenshot-layer: Fix memory leak in writePNG function
The writePNG function was not freeing allocated memory in error cases,
leading to potential memory leaks. This patch ensures proper memory
cleanup in all execution paths.
Signed-off-by: Cong Liu <liucong2@kylinos.cn>