Notify consumer thread before exiting the producer