Modified grabToLocal to make use CURLOPT_FILE

This avoids loading the whole content in memory before saving it to the file system.