Throw an exception if invalidate is called on a read-only realm