libweston: mitigate race when destroying outputs
With some displays connect, disconnect, connect events can happen is a very short amount of time. When this happens, the output global may already be destroyed when a client tries to bind it. As a result, the client is disconnected with a protocol error. See [1] for more details on the general problem.
To mitigate this problem call wl_global_remove() first and call wl_global_destroy() several seconds later. This is inspired by the implementation for the same problem in wlroots.
Signed-off-by: Michael Olbrich m.olbrich@pengutronix.de