CRM-14210. Use get_headers() and check for 200 response instead of file_get_contents(), as some servers do not return FALSE on 40x response code.