bugfix: when setting up a curl handle, DNS caching and SSL session caching were not properly initialized
optimization of directory_empty(): The original version of the function downloaded a full listing of the directory, whereas it is sufficient to check for a single entry. For directories with many thousands of files the modified implementation saves not only network bandwidth but also the number of round trips to s3.