State should also be saved if there is a problem in the onBeforeSave

Whenever there is an error the model saves the state if this is set to true. Currently this does not happen if there is a problem with the onBeforeSave() method. State should also be saved in this case since it is also running into a problem.