Ensure that log rotation does not read excessively from the log.

Rotating the logical log should not read more transactions from the log than necessary when copying transactions from the old log to the new log. Even if there are no open transactions...