drm_hwcomposer: Fix sync_file fd leak and unnecessary dup from "Rework audofd"

John Stultz requested to merge john.stultz/drm-hwcomposer:sync_file-leak into main

In commit 0fade37a ("drm_hwcomposer: Rework autofd"), a change to some very subtle existing code caused a resource leak such that after 10 minutes or so of active display output, we would start seeing:

android.hardware.graphics.composer@2.3-service: failed to dup fence 10

over and over in logcat. Moving the mouse would cause black frame to flicker and eventually Surfaceflinger would crash and restart.

This merge request tries to fix this serious leak as well as a likely unnecessary dup added in the same change (along with the TODO to fix it).

Merge request reports