Only write out modified persistence windows.

Recreating this against 1.9-maint.