Fixed the hang when the device is locked

When the device is locked, we get empty packets in the server.
Now fixed by closing both the lldb and server sockets.
Also after safequit, we need to detach to make the "justlaunch" option to be less error prone.