location: Fix error handling in uri parsing

At the moment calling set_from_uri with error as NULL will
cause a segmentation fault.

This is because the code assumes error will always be set.

https://bugzilla.gnome.org/show_bug.cgi?id=737979