Added shutdown hook to PersistServcie in unit test.