Check that uri.pathname is not undefined before using path to resolve it

See bottom of http://techblog.realestate.com.au/setup-cartodb-dev-environment-on-mac-os-x/. Also necessary for standalone Windshaft-based app.
Merge pull request #77 from dshorthouse/patch-1

Check that uri.pathname is not undefined before using path to resolve it