fixed severe bug in reallocation of memory
moved tf-idf measure into parallel libsvm_input