Redmine/6553: Fix implicit looping over multiple lists

Pull request for initial review of the changes to the code. Planning to add more test coverage to the acceptance test before merging.
In fact, every caller uses this in the pattern `while (RlistEntryIsCfNull(entry)) { entry = entry->next; }`, and the entry is always non-const, so why not in fact replace it with the following ?
```
static Rlist *FirstRealEntry(Rlist *entry)
{
    while (entry && entry->val.item &&
              entry->val.type == RVAL_TYPE_SCALAR &&
              strcmp(entry->val.item, CF_NULL_VALUE) == 0)
    {
        entry = entry->next;
    }
    return entry;
}
```