Fixed build.ps1 for osx package
Gracefully exit on restart instead of forcibly killing it