Refactor synapse.storage._base._simple_select_list_paginate.