hwc2: Check if we're under max rlimit

Before setting the fd rlimit, check if we're under the max limit.
This is needed for hwc2 tests where the same process opens and
closes hwc2 multiple times.

CRs-Fixed: 2028924
Change-Id: I48b0efaefdad1bad1064d9c34adeeec095083984
1 file changed