Fix local push to file:// URL.
Add test for pushing to a local file:// URL.
Fix a compile warning.
Factor out code to convert local "url" into a path.

Previously this code was shared between `local_push` and `local_connect`.
Merge pull request #2057 from GrahamDennis/local-file-url-push-fix

Fix local push to file:// URL.