cuda.c: print_reverse_list: improve error handling