registrar: add path-URI prefix filter to lookup()

- Add a third, optional parameter to module function lookup(),
  specifying a prefix to match against each contact's path URI
- If the filter is given:
    - skip contacts with path-URI not beginning with that prefix; use
      the first matching one to rewrite message destination URI.
    - don't append branches for remaining contacts with path-URI not
      beginning with the specified prefix.