Fix issue #32: pip crashes when server does not send content-type header

Thanks Kelsey Hightower for pointing what to change.
Change test to use set() comparison and add docstring

Using set because and os.listdir() does not guarantee ordering.
Merge pull request #872 from hltbra/issue-32

Fix issue #32: pip crashes when server does not send content-type header