Fix segfault when exception occurs in Python
Also add a test set. Unfortunately the test set also succeeds before the fix, because it seems to be an interplay with WSClean and how it uses Python.
Also add a test set. Unfortunately the test set also succeeds before the fix, because it seems to be an interplay with WSClean and how it uses Python.