Upgrade to 5.2-Exit Edit mode hangs
Should have done that from the get go.
Well, I first posted the question, then looked for the answer and found it. I cleared the directory /files/cache from all its files, that didn't help. Then I deleted the cache-directory, created a new one and changed its permissions to 777 and that helped.
A noticed that the original directory had the permissions 755. Could the problem be the access rights to the directory?