Stop recursing on slug after 3 attempts

This is to prevent aribitrary execution of db queries by constructing a
url with a large directory structure. It is also the current behaviour
of spotlight.