Wl lifetime fixes

These changes fix various glitches in wayland platform window and buffer lifetime handling.