Fixed issue #9181: When dumping database sometimes lines are left out