Reset device to initial state in disconnect()

Added code to reset the device to the initial state when disconnect() is called. This prevents calls to configured() from returning true when the device has been disconnected.