compositing: Move compositing off the main thread.

Because the compositor no longer runs on the main thread, it can now use
plain old Rust channels for communication, and the main thread instead
receives the special "proxy" treatment. This change also makes the
compositor entirely optional; in headless mode, no compositor is started
at all.

This change will allow us to support multiple windows, since those must
have separate compositors. It should also improve our event dispatch
latency, since even less runs on the main thread, and we can handle
events while waiting for buffer swaps.

Additionally, this patch refactors many of the task startup functions,
which took too many arguments, to use initialization structures. This
makes the code easier to read.

Closes #4228.

r? @glennw