Add tests for sorting files after compacting

I'm not sure how any of these values ended up as nil, since they are
converted to an array upon setting and getting, but it seemed to be
happening in the wild. See https://github.com/rubygems/rubygems/pull/763