Fix: possible use after free in consumer

Fixes the coverity issue 1019959.

Signed-off-by: David Goulet <dgoulet@efficios.com>