Avoid hanging in state Closing
Avoid hanging in state Closing

With xen 4.14, libxl is setting the vinput backend to state
XenbusStateClosing and waiting for it to transition to
XenbusStateClosed.

When a frontend is attached, it should see the backend state change and
start closing itself.  When the frontend closes, the backend will react
and close.

With a Windows HVM without PV drivers, I'm seeing a 10 second hang.
There is no frontend driver, so the frontend doesn't change.  Then the
backend doesn't change and it hangs.

Detect this case and disconnect() which will set ours state to Closed.
The xenstore frontend state is XenbusStateInitialising, but the library
caching has it set to XenbusStateUnknown.  Trigger the behaviour for
both cases.

Signed-off-by: Jason Andryuk <8558cf2f125c210e58f86c566cb85d5e97963455@gmail.com>

OpenXT/libxenbackend