Fix manager unregisters or exits during GenEvent stream

Previously if a manager unregistered, the handler would not be removed
during cleanup. This could occur due to a netsplit when registered using
a distributed register such as :global.

Previously if the manager exited without sending the :gen_event_EXIT
message the stream would not stop. This could happen if the GenEvent was
on a disconnected node or was killed.

Previously if the manager was shutdown this would cause a stream to
stop. However an attempt to remove the handler would fail because the
manager was down.