Fix crash on closing Krita dues to KisOptimizedByteArray
The static objects may be deleted in arbitrary order, which means
the default memory allocator may be destroyed before the last dab is
destructed (in the brush server). The patch just makes all the memory
allocators be a shared pointer.