Question on whether I have committed plagiarism (modifying paragraphs from an unpublished document sent as email attachment for PhD thesis)
Not knowing the policies of your university, nor of your advisor, it is hard to be definitive in an answer here. However, I'll suggest that you do two things. One is to re-write the paragraphs as you seem willing to do, but also contest the characterization that the original wasn't joint work with you as an equal contributor. If necessary (and possible) make your claim formally, in writing. You don't need to accuse the other student of misconduct, but you need to be clear that you worked jointly. The other student may just misremember the interaction, of course. Best if you have preserved some evidence of course. 

I would also try to get the professor to stand up for you with the internal examiner. 

If you are reporting accurately, then nothing you did was wrong unless the attachment was somehow published and you failed to cite it. That would be self plagiarism and is in a different category than ordinary plagiarism. 

My personal opinion about self plagiarism is that you can copy and include your own unpublished work without citation, but need to cite earlier work of your own rather than just copying. That is to permit readers to trace back and find the complete context of a work. 

However, there is one aspect I'm unclear about. If the attachment wasn't ever published, how did turnitin even find it for analysis? If it was published, perhaps without your knowledge, that raises other issues.