Optimize querying with private review requests.

When querying lists of review requests that contained private review
requests, the query ended up joining enough tables where the query could
take a substantial amount of time to execute.

This change optimizes the query by pulling out a couple of the more
expensive joins into a couple simple queries. The result is a much
faster query.

Reviewed at https://reviews.reviewboard.org/r/5669/
Merge branch 'release-1.7.x' into release-2.0.x