Ensure async handler are not called multiple times when closing logs.