This matches what we do in rpm-ostree. Move the `glnx_fd_close` bits out of `make syntax-check` in preparation for dropping that.