Fix range exception on empty query string

When a URL with a empty query string (ex: http://domain.com?) was passed to
canonicalURL a range exception was thrown due to rangeOfString: returning
{NSNotFound, 0}