Fix bug where we used an unbound local variable if we ended up rolling back the persist_event transaction