fix ask to save file on closing if modified
Merge pull request #1797 from diegosarmentero/master

fix ask to save file on closing if modified