Report load failure of cert files only with --debug

Fixes #41331
Fix memory leak in OpenSSL code
Make 504 Gateway Timeout non fatal
Fix loop check in FTP code

Reported-by: Coverity scanner
Use random() and srandom() if available.

Reported-by: Coverity scanner
Fix memory leak in utils.c
Fix potential memory leak in main.c