Fixed the gridliner test to handle backends which do not correctly trigger draw (e.g. GtkAgg).