Improve GenEvent.stream/2 cleanup

Makes the cleanup of the Stream resource more efficient by reusing the
monitored process and its link to ensure the handler has been removed.

The flushing of messages, after removing the handler, is also only done
when needed.