tdb: use O_CLOEXEC if available