So, to correct this error one should get the content editor webpart to editing mode, open the rich text editor and there swich to the html code view with the < > -button and delete these div-tags. Not an easy task though, when this very thing is causing an error opening the webpart menu! On one site, I managed to get the menu to work again by closing the webpart and then adding it to the page again from the closed webparts gallery. But on the other sites, trying to close the webpart only ended up in a SharePoint error page.
So what I did, was to open the page content list by adding ?contents=1 on the address bar after the page url and delete the whole webpart on that page. There it didn't cause an error. After that I could add a new content editor webpart on the page, without errors. And since I still wanted to restore the old contents, I had copy-pasted it form the page to notepad, from which I could then again copy-paste it to the new CEWP, clean.