Fix deadlocks in KoShapeManager caused by bezier curve fix
- Some shapes (e.g. Text Shape) may emit shape-changed signal right during painting. It would cause a deadlock.
- add/removeShape methods should be more careful about locking because of their tail-recursion nature.
BUG:410909
BUG:410572