Since the weekend, I ran kwin without compositing. Since then, I haven't seen this happening, so I think this is a bug that is triggered by kwin when compositing, likely since 4.7.0.