tests: Test EBADF and errno handling when closing fds

Signed-off-by: Simon McVittie <smcv@collabora.com>
11 jobs for wip/smcv/autofd in 12 minutes and 51 seconds