Recent changes on updating normals during sculpting broke the applying
modifiers when in weightpaint, vertex paint and texture painting.
It seems that the mpoly and mloop get special indexes (UINT_MAX,
SHORT_MAX) what leads to reading in unallocated memory.
This revision disables updating normals when the sculptsession is in
weight, vertex or texture painting. I haven't been able to detect the
root cause of this issue.