tiling: fix some asserts from scripts
scripts could trigger some asserts:
- it was possible to tile unmanaged windows, which caused an assert on !tile at window teardown, simply forbid it.
- if a window was tiled as soon it appeared, it was possible the window got destroyed before commitTile was called, causing an assert in commitTile !isDeleted, in this case only make sure the tile we are assigning is null
backport from !6761 (merged)