Saving application settings on main form close.