Prune locks
This adds the ability to have any number of internal or external locks to prevent pruning specific block ranges.
Some examples where this would be useful:
- Ensuring any known Core wallet won't become unable to sync due to pruning when it is unloaded. (Included in this PR)
- Ensuring pruning doesn't go too far for a desired-functional wallet backup. (Questionable, since you probably lose the node if you need the backup anyway?)
- Allowing users to temporarily disable block indexes and filters, without pruning cutting them off from catching up later.
- Avoiding pruning out from under external wallets (Armory, EPS, etc) that might need block data.
- External block indexes/filters, etc.
By design, users retain complete control over prune locks, and can delete them out from under applications using them. This is to avoid circumstances where a prune lock has been set, by an application that may no longer be used.