Fix for Bug 386726 (https://bugs.kde.org/show_bug.cgi?id=386726).
The symptom is that Krita crashes when the smoothing option is changed from the stabilizer to something else or from something else to the stabilizer during a stroke.
The first case happens because the stabilizer draws lines even after the user has removed his pen from the canvas, but this isn't what other smoothing options do: they end the stroke and remove it from the memory immediately after the user removes his pen. If the smoothing option is changed from the stabilizer to something else in the middle of a stroke, after the user removes his pen, because the smoothing option is no longer the stabilizer, the stroke and the painting action is removed from the memory; but because the stroke started as a stabilizer stroke, the stabilizer tries to finish the stroke and the action, which no longer exist. In this process, KisRecodingAdapter::addLine(), which doesn't check the m_pathPaintAction pointer before dereferencing it, is called, and there' a segfault.
I added pointer checks to KisRecodingAdapter::addLine(), and made the stabilizer finish the stroke only when the smoothing option is set to it.
For the second case, I haven't looked into it, but the code written to solve the first one seems also able to solve it.
Changing smoothing option in the middle of a stroke still causes unexpected behavior, the stroke would be a mess, but at least that's a behavior that can be cancelled by ctrl + Z and doesn't cause artists to lose their work.