bugfix for concurrent access to bitmap from update and repaint