now checking calloc return values in ntok and split functions
Switched a better way of checking for EINTR errors around open/close/ftruncate suggested by @worr