Add a script to lock/unlock writes to an index

This is useful to block updates while a dump/reload is going on, to
ensure that no changes get lost.