Fix crash when using Pencil Tool with a tablet
The patch basically makes KoPathShape::outline() cont-safe. Q_FOREACH
doesn't support thread-safety, because it relies on copy-on-write.
Every non-const access during Q_FOREACH will casue a detach, which
is not safe in multithreaded environment.
CCBUG:412530