Since Version 2.4 openldap supports server side sorting and paging please add this feature by creating a use flag and enabling it at configuration time
It's already available under USE=overlays; use that instead.