Fix a file descriptor leak in BackgroundEventLoop.