isl_list_templ.c: extract out shared isl_list_*_check_index
isl_list_templ.c: extract out shared isl_list_*_check_index

The extracted function will also be used in the next commit.

Signed-off-by: Sven Verdoolaege <e5350bbed4977f5eb8ae1dc6abd9ae59d21ace75@kotnet.org>

inducer/isl-mirror,PollyLabs/isl,nicolasvasilache/isl,inducer/isl-mirror,PollyLabs/isl,tobig/isl,nicolasvasilache/isl,nicolasvasilache/isl,inducer/isl-mirror,PollyLabs/isl,nicolasvasilache/isl,nicolasvasilache/isl,PollyLabs/isl,Meinersbur/isl,tobig/isl,inducer/isl-mirror,Meinersbur/isl,PollyLabs/isl,Meinersbur/isl,tobig/isl,inducer/isl-mirror,tobig/isl,Meinersbur/isl