SSP-1681 Inject row_number() invocations after Hibernate formulas

This is just for our SQLServer dialects. Formula
subselects were being clobbered whenever we ran a paginated query.
PostgresSQL was unaffected because that dialect just uses a simple
LIMIT.