Fix race conditions in ViewerGL