Fixes issue #3122 of filenames being taken as URL

I have added more checks to verify that given fileobj is an url by checking the scheme. The scheme is returned by urllib.parse.urlparse(urlfile).scheme - which contains the protocol for urlfile. For a valid URL, the scheme could be HTTP, HTTPS or FTP, hence anything else returned apart from this should not be treated as URL and should be treated as File.
I'd prefer not to check against a hard-coded list of protocols.  It's true in practice these are the most likely to occur, but it is possible for urllib to support others in some particular application such as 'nfs://' or 'ssh://' etc.

Since I'd rather avoid making a semi-arbitrary restriction (the use of urlretrieve here should eventually be replaced by Astropy's download framework anyways--see #3041) and instead just change this code to first check if the supplied filename exists on the filesystem and go with that rather than assuming a download from a URL if a file by that name exists.

Or you could try to fix #3041 .