fix: consistently treat entry indices as uint64_t in tclhandle
This code intermingled uint64_t and int values for representing indices into an
array. Making this consistent removes a huge number of -Wsign-conversion and
-Wsign-compare compiler warnings, as well as more serious problem where printing
code assumed "%lu" was the format code to print an index. This is not true when
uint64_t is not the same type as unsigned long and would have most probably
resulted in stack corruption.