use a shutdown function so curl gets closed even when users abort loading - maybe this helps against "No buffer space available" (which appears in the Apache error log)