How bad is it to put the wrong details in a cover letter?
Sometimes mistakes like this happen. Also, faculty search committees recognize that candidates are applying for multiple positions at one time, so it wouldn't necessarily send up red flags. Most candidates will use a template for their cover letter and change things around. I've chaired search committees and will say that having the university name correct, but the area (you mention it is related) incorrect would not be a fatal flaw for a candidate. However, I might be extra careful at looking at his or her other content/materials for fit and would be more likely to view any additional typos or mistakes as basic sloppiness. 

However, it also depends on how competitive that specific position may be. If there are a number of stellar candidates and one made the mistake, it would be easier to rule that person out to make decision making easier. I do not suggest contacting the faculty search chair or members. It will only emphasize that you made the mistake. 

Maybe to boost your hopes...I searched for my first faculty position during the recession and applied to 120 positions over a two-year period (many schools lost funding for positions after they were posted, so it was advised to apply for EVERYTHING). One school called me for a campus visit and I was excited. To prepare, I reviewed the cover letter I sent them...only to realize that I wrote the wrong university on the cover letter! With 120 applications, I gave myself some grace for the error. However, it didn't stop me from getting interviewed for the job - the rest of my application made up for the error. Good luck!