Check open_basedir before using CURLOPT_FOLLOWLOCATION