loader: Fix Wayland support

All that was needed was to fix some misplaced braces, fix a couple of
copy+paste problems from Mir, and add a lookup function.  Getting Mir
support working should be pretty easy.

Conflicts:
	layers/swapchain.cpp
4 files changed