Bug 946213 - [builds] Kill the app after flashing r=ochameau

* kill the flashed app after flashing
* use a target-scoped var for TARGET_FOLDER
* use non-recursive vars for APP_NAME and APP_PID, because they're used at
  several places and it makes no sense to run them each time