Curl multi-session fixes

Alternate to #4543. Addresses the issues in http://forum.xbmc.org/showthread.php?tid=189963.