Fixed a few GC issues

Not all elements were released when an awindow was destroyed. The layout
change in multilayout demo still causes memory leaks.