The monitor can experience various connection issues, which will result
in connection closed errors. This commits adds handling of these errors
and will retry the connection.
The handling of ConnectionRefusedError is also changed, and will no
longer throw an exception if encountered. Instead, the ensemble is
cancelled, and the number of successful realizations is reported.
The responsibility of deciding experiment failure/success based on
number of failing realizations is left to the parent scope.
Test are also added to show that the correct number of successful
realizations is reported, even in the event of connection refused and
connection closed errors.