Deferred saving of latest level

Deferred saving of latest level to localStorage till the level has been loaded so that erroneous levels not get saved. Fixes #433.