4a66a4a384
The write loop was crashing with 'name instance_id is not defined' when processing resize messages. This caused the connection to drop with 1006 and the frontend to reconnect in a loop. Fixed by passing instance_id as a parameter to _write_loop. Also cleaned up debug logging.