hgweb.cgi: fix internal WSGI emulation (issue3804)

The internal WSGI emulation in wsgicgi.py was not fully WSGI compliant and
assumed that all responses sent a body. With 3fbdbeab38cc that caused a real
bug when using hgweb.cgi.

wsgicgi.py will now make sure headers always are sent, using the pattern from
PEP 333 and similar to how it is done in c007e5c54b16.

--HG--
branch : stable
largefiles: don't crash when trying to find default dest for url without path

b32e55e6c3c7 introduced a crash when cloning a url without path - where
util.url().path would be None.

This None will now be handled as ''. clone will thus abort with 'repository /
not found' as before.

--HG--
branch : stable
merge with stable