Workaround for CURLOPT_FOLLOWLOCATION

Fix CURLOPT_FOLLOWLOCATION bug with open_basedir or safe_mode restriction enabled.
Bug Description:
https://github.com/owncloud/core/issues/1916