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.
You are right, we actually do not need the first condition.