Percent escape strings before creating URLs

URLWithString will return nil if the string contains invalid URL
characters (such as spaces). Percent escape the string before attempting
to create an NSURL using it.