char_device: Don't set active when stopped and don't access dev after unref
char_device: Don't set active when stopped and don't access dev after unref

2 closely related changes in one:
1) When leaving the read or write loop because the chardev has been stopped
active should not be updated. It has been set to FALSE by
spice_char_device_stop and should stay FALSE
2) The updating of dev->active should be done *before* unref-ing dev

Signed-off-by: Hans de Goede <9fa1be1a5b5729e4c6b404f34c9ce49ff4882fd8@redhat.com>

elmarco/spice,elmarco/spice,elmarco/spice,freedesktop-unofficial-mirror/spice__spice,SPICE/spice,fgouget/spice,freedesktop-unofficial-mirror/spice__spice,ya-mouse/spice,fgouget/spice,freedesktop-unofficial-mirror/spice__spice,alon/spice-server,alon/spice-server,Fantu/spice,Fantu/spice,fgouget/spice,freedesktop-unofficial-mirror/spice__spice,fgouget/spice,alon/spice-server,SPICE/spice,SPICE/spice,elmarco/spice,alon/spice-server,elmarco/spice,ya-mouse/spice,Fantu/spice,Fantu/spice,freedesktop-unofficial-mirror/spice__spice,ya-mouse/spice,alon/spice-server