HttpServer: Change create_token to use Flask's jsonify function

The jsonify function is Flask's intended way of creating a JSON response
to a request.
vmnetx-server: Update last_seen when server connection receives client ping

The ping signal notifies _ServerConnection that the connection
between the client and the server is still alive, and therefore should
update last_seen in the _TokenState.
vmnetx-server: Add garbage collection to remove idle tokens
HttpServer: Look for secret key in headers instead of body of request

By placing the secret key in the header, GET requests which lack a body
can also authenticate with the HTTP server.
VMNetXServer: Remember to take _lock in _destroy_token
vmnetx.server: Note methods called from HTTP worker threads
LocalController: Drop redundant test

Now that we track initialized/shutdown state in Controller.state, we
don't need to separately test self._conn.
LocalController: Make stop_vm() asynchronous

The UI assumes that stop_vm() is asynchronous, when in fact it wasn't.
We only need it to be synchronous when called from shutdown(), so handle
that case specially.
Controller: Eliminate startup_cancel()

startup_cancel() and stop_vm() are really the same thing in slightly
different contexts.  Merge their methods, signals, and protocol messages.
Convert startup-failed into informational signal

For consistency, send vm-stopped after a failed startup.  Convert
startup-failed into an informational signal which only delivers the error
message.
Rename startup-complete signal to vm-started

It fires after reconnection as well as immediately after VM startup.
LocalController: Avoid race if startup is cancelled very early

which could cause the cancellation request to be ignored.  Since the
progress and main windows would already be hidden, the VM would start
successfully and continue running with no indication to the user.
Fix spurious vm-stopped signal after rejected memory image

If libvirt delivered a VIR_DOMAIN_EVENT_STOPPED event after the startup
thread had retried startup without the memory image, the Controller state
would be improperly reset and the UI would try to start the VM when it
was already running.
Fix deadlock in VMNetXServer.shutdown() when VMs are running
Fix AttributeError trying to transmit on a closed endpoint

triggered by _Pinger._timer().
vmnetx.ui: Avoid race if startup is cancelled very late

which can cause the cancellation request to be ignored.  When the UI
receives the vm-started signal from the controller, notice this and
properly shut down the VM.
Revert "LocalController: Avoid race if startup is cancelled very early"

LocalController._launch_lock was preventing the stop thread from actually
stopping the VM until startup was finished, thereby making it impossible
to actually cancel startup.  The UI now has its own code to recover from
cancellation races, so rely on that to handle the early-cancellation case.

This reverts commit 6c5a3a47696b84041a714187578522fa4f8a14f5.
Merge branch 'multiserver' of github.com:dayoonc/vmnetx