This patch fixes T90120. The fundamental problem is that 2d and the old 3d paint modes share a single Paint struct, ToolSettings->imapaint. This patch is a temporary fix until the new 3d paint mode (which has its own Paint struct) is released.
The patch works by listening for NC_SCENE|ND_MODE inside image_listener in space_image.c. It does not use ED_space_image_paint_update since that requires a bMain. Instead it calls paint_cursor_start (which is promoted to ED_paint_cursor_start). image_paint_poll is also promoted to an ED_ function.