LPS-47192 Fix possible NPE (selectedLayoutAncerstorsIds) and further enhancements:

1st scenario - Add new WC using "Link To Page" field:
a) There is no selected layout --> Retrieve filtered "layouts" using remote service (layoutService)

2nd scenario - Editing existing WC that has a "Link To Page" field:
a) Retrieve "layouts" using local service (layoutLocalService)

b) Retrieve the "selectedLayout" for the "selectedPlid" using local service.

c) If the layout exits, create a list called "selectedLayoutAncerstorsIds" that contain the layoutIds of its ancestors layouts. I do this, because it may happen, that a user has VIEW permission for the selectedLayout,  but doesn't have for its ancestors (weird, but possible scenario...), and we need those layouts in order not to have "gaps" in the selection tree (--> how would you display a child without its parent otherwise?)

d) Iterate over the "layouts" and display the "curLayout" (and invoke the "getLayoutOptions" macro for its descendants) if any of the conditions return true