gh-155477: Fix multiprocessing.Pool deadlock on close() with a buffersize imap (GH-155478)