correct some errors and inefficiencies

 - more efficient memory allocation using calloc directly
   when a number of members is specified

 - correct a bunch more 64 bit errors in XChangeProperty: these
   take long pointers (not int pointers) when format is 32.