fixed java.util.prefs.BackingStoreException when flushing the preferences at shutdown