browse: Fix issues when context is a release targeting a directory
When browsing contents or directories in the context of a release targeting a directory, there will be no revision identifier involved in the snapshot context.
This was causing HTTP errors 500 when a staff user was logged in and an empty revision tab was displayed in the Permalinks dialog for all users.
Migrated from D6711 (view on Phabricator)