Encode ID used in REST endpoint URL

The Gerrit documentation says following:

  "All IDs that appear in the URL of a REST call (e.g. project name,
  group name) must be URL encoded."

As this wasn't done, project where the name was something
like "parent/project" didn't get messages from Gerrit.

The branch name can also have characters that must be encoded.