Wrap replay() in a try/finally to protect against InvariantChecks bailing out
with sys.exit