JInstallerHelper::downloadPackage(): fix redirection loop, lost filename

See also: 
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=30357