Call font-lock-{flush,fontify-buffer} only when font-lock-mode is on.