Close old logger when rotating, fixes #1008