seg.fault in pthread library