Publication - discovered an error in the proof of theorem which the referees have not spotted, what to do?
You absolutely have to advise the editor and referees of the error, and either correct or remove the erroneous part.  It doesn't matter how much it annoys them, or even if it leads to the rejection of your paper.  Keeping it there would be totally unacceptable and unethical.  

Just tell the editor straight out:

"I discovered an error in the proof of Theorem 1.2.3.  It does not seem to be fixable, so this theorem should be removed from the paper.  The rest of the paper is unaffected [assuming that it actually is]."

The editor will probably ask the referees to re-review the paper with this information.  It might change their decision, or it might not.  But even if it gets rejected, that's something you just have to live with: fix the paper and submit it somewhere else.

You seem to be assuming that the referees noticed the error but decided not to say anything about it in their review.  I doubt that.  It's far more likely that they didn't notice it at all.  Referees are humans and not omniscient gods, and just because they overlook an error does not mean it is okay to publish it.