sqlitemodel: fix endless loop if offset is used in LIMIT