Handle open_basedir & safe mode for CURL

When safe_mode is enabled OR open_basedir is set, CURLOPT_FOLLOWLOCATION throws an error.
This fix is also in the official S3 SDK

Message: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when
in safe_mode or an open_basedir is set