Raise exception if attempting write txn in readonly env.