Fix novnc rendering when the window is detached

(cherry picked from commit 4a505d22636913126ee589777dc5b88ff22e376d)