Open LOG_LOCK file with FD_CLOEXEC to prevent file descriptor leakage

Fixes #5399