upload: fix -q option and add more debugging output
add pthread for upload
upload: use one upload worker thread

And some cleanup
finish upload earlier to avoid display problems
upload: verify SSL peers and use CA file in /etc/ssl/certs/cacert.pem
handle SIGTERM and SIGHUP to gracefully shut down
improve error messages
fix some warnings
make more functions and variables static
ANSI function definitions
upload: add random delay (jitter) before uploading
upload: print sequence number
add proper include files
update copyrights for 2014
more includes to silence warnings
upload: initialize pthread variables differently

to silence sparse warnings
pass curl functions by address
upload: be more careful about uninitialized states in finish
enable more gcc warnings and fix some
fix signed/unsigned warnings