Fix unit tests from the write path async rollback.
Fix UniqueId to pass the actual runtime exception instead of recasting as a
generic in getOrCreateId.