powerapps designer (at windows) should show a warning if not saved if the user clicked close
As per AndyPennell's response below.
Unfortunatly this is not possible: Modern windows apps do not get a chance to do this. (Weird, huh?).
However, if you immediately launch a new PowerApps it should ask you if you want to recover the document you were just working on.
it is possible to disable the X ?
(this recover system works after a crash)