Fixed realm URI computation for the case of non absolute uri, null query, and not omit query

Cases and returned results by values of realm.isOmitQuery() and query:

Before:
omit, "query" => "path"
omit, null => "path?null"
don't omit, "query" => "path?query"
don't omit, null => "path?null"

"path?null" is obviously a wrong result.

After:
omit, "query" => "path"
omit, null => "path"
don't omit, "query" => "path?query"
don't omit, null => "path"