Locks or unlocks the buffer for modifications. If a buffer is locked, all modifications are blocked, not just user modifications.