Implement graceful stop in `amqp_gen_consumer` and `direct_consumer`.