Allow callback to determine if a second persist is needed

Closes #354

Signed-off-by: Graham Campbell <graham@mineuk.com>