Add curl debug function

Record curl debug information. The information is printed in case a download
results in a non HTTP related error. Usefull to debug protocols with authentication.