The only way to correctly stop the gateway, is to use the Launcher REST Service Manager from the start menu.
You click on “Quit Service” into the Service menu: