For some reason I've never had this problem so I can't say specifically why it's happening, but since ninja.exe is the parent of all spawned processes, why not find ninja.exe in Task Manager and right click it and choose End Process Tree? (Note that there will be many instances of ninja.exe, but only a single instance with the command line that you originally launched it with.
You could script this into a batch file or powershell file I suppose, so that you could just type kill_ninja_build.bat from a command prompt.
If you're feeling adventurous, you could try to investigate why it's happening. I kill ninja builds in progress all the time, and have never seen this.