scripts/gdb: clean up error handling in list helpers