The current placement creates confusion about what you’re actually closing out of when you click it. It makes me hesitate and wonder what I am about to close.
If you click it when there are multiple files open, it just closes out of the tab on top. If you click it when there is only one file open, it closes out of the whole pane, including the Sequences and Variables windows.
It would eliminate any ambiguity if the X for each file were on the tab for that file and if there were a separate X for the pane, like you typically see in tabbed programs.
You could also just put an X next to the pin on each little window instead, like the X in the Step Settings pane and the Insertion Palette in the screenshot above.