[builtins] don't activate an already active window

As a result of the discussion in #5076, this adds a conditional check to the builtins `ActivateWindow`, `ReplaceWindow`, `ActivateWindowAndFocus` and `ReplaceWindowAndFocus` which prevents an already active window becomes active (closed/re-opened) again.

@jmarshallnz mind taking a look