Fix allocation of memory for the table of handlers
Fix allocation of memory for the table of handlers

* Fix calculation of the table length: the number of
  items in the table must be equal to the maximal
  signum, not one less.

* Thread private data management is split into two
  separate procs: one for the allocation and another
  for just returning the allocated block.
  This approach does not require storing the memory
  length in a static variable or calculating it each
  time or introspecting the "thread data key" which is
  defined to be opaque. The API does not state explicitly
  that the calls to Tcl_GetThreadData() other than the
  first do ignore their "size" argument, but it is
  logically follows from the spec.

kostix/posix-signal