Changing lsdir to consistently return an slist

This is a backport of 6807e0dda5bd265c9bbee631fffb2ec0aa68adaa to the
3.4.x branch.
Switching to new use of CF_NULL_VALUE as requested.
Merge pull request #777 from werkt/3.4.x-lsdir-slist

Changing lsdir to consistently return an slist