Detect invalid use of wxPaintDC/wxPaintEvent better. See https://github.com/wxWidgets/wxWidgets/pull/1732