Thanks for clarifying what tss_id and p_id correspond to and for the potentially useful script.
You say that a given tss_id refers to a same start position of the first exon. In the particular case of C. elegans, many genes are subject to trans-splicing: the 5' end of the transcript is replaced by an RNA coming from somewhere else (see http://wormbook.org/chapters/www_transsplicingoperons/transsplicingoperons.html). The transcription start site can therefore be upstream of the first exon. I don't know if the gtf files from illumina take the real TSS (when it is known) or the starting position of the first exon when they attribute a tss_id.