Fix for open_basedir on shared hosting

When open_basedir is set, the CURLOPT_FOLLOWLOCATION will cause an error and fail. This code works around that issue, which is common on shared hosting.