Follow-up 36f4daf32c: allow no-write database connections to use transactions