PersistentManager - made maximum number of write attempts configurable