REST API: Fix OAuth process.

The OAuth registration process was failing for sites where site_url was
a subfolder.