Check if cURL is available

Add a simple check to make sure cURL is available before using it. If
not, the scritp would use the fsockopen