erlang: clear any remaining messages before freeing the queue