move empty object name detection where it belongs

Commit 9679f269 added empty object name detection.  But that was done
"too far down" - it needs to be done when the list is first read from
S3, not later every time the list is iterated.