Fix support for CURLOPT_WRITEFUNCTION
Don't follow redirects if open_basedir is defined
Add a few braces to prevent mistakes