log: fix major fd leak in reading