bring back the notion of a dirty plot

Plot dirtyness was removed in @c157332128bda0addf3dbdb9e23fc348151d53c8
This new approach is a bit cruder: all plotting actions make the plot
dirty, and only PlotWidget.repaintIfNeeded() takes it into account.
Hopefully this will be almost as efficient and less error prone.