Ensure that the frame region is always set as soon as the window is decorated.
Further ensure that the window decoration isn't needlessly reset if the
window already had one.
Refactored XShape usage into a common function.
Added tests to verify the behaviour of shape set on initially creating
a decorated window and also upon changing the input frame window shape
(LP: #1158267). Fixes: https://bugs.launchpad.net/bugs/1158267.
Approved by PS Jenkins bot, Christopher Townsend.