Locks or unlocks the buffer for modifications. If a buffer is locked, all modifications are blocked, not just user modifications.
If lock is #f, the buffer is unlocked, otherwise it is locked.