Limit concurrent connections

I've written a function to manage the downloads in order to limit the number of concurrent connections to 10 (can be adjusted by variable parallelAvail).