shiny/driver/gldriver: implement lifecycle events for X11.

This adds a new shiny/driver/internal/lifecycler package, to share code
across the various drivers.

Also remove the X11 gldriver's ButtonMotionMask event subscription, just
like the x11driver. It is redundant with PointerMotionMask.

Also fix an off-by-one error in the X11 "is a window visible"
calcuation. A 10 pixel wide window located at X == -10 will not be
visible, as the (x+width) upper bound is exclusive, not inclusive.

Change-Id: I0ded722160588e30d1e323a283a0d396ffd398a5
Reviewed-on: https://go-review.googlesource.com/23079
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
10 files changed