lib/list_sort: test: improve errors handling