Add end-of-stream flushing

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
Remove finished frames from hash table

This makes sure the hash table does not grow all the time

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>