Phabricator used to have a bug where absolute path were used instead of
relatives, causing the diffusion.browsequery endpoint to fail:
Since the bug is fixed, the browsequery endpoint will requires a
trailing slash in the directory input (path parameter) or it will
return an empty result.
This is a bug that will probably be fixed upsteam at some point, but in
the meantime we can add this trailing slash to work around this issue,
since this should also be a valid input.
Note that searching for / (root path) throws an error, so this diff
uses an os.path.join(dir, '') call to make sure the trailing slash is
only appended to non empty directory names.