Added on_statschange callback
Set our status to Offline before closing.