libctf: work on platforms without O_CLOEXEC.