Check if cURL is available

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