static DomainObjectLockHold lock(DomainObject object, String reason) {
		if (object.lock(reason)) {
			return new DefaultHold(object);
		}
		throw new DomainObjectLockedException("Could not get lock");
	}
Wrapper for {@link DomainObject#lock(String)}

@param object the object
@param reason as in {@link DomainObject#lock(String)}
@return the hold, which should be used in a {@code try-with-resources} block
@throws DomainObjectLockedException if the lock could not be obtained
Ghidra/Debug/ProposedUtils/src/main/java/ghidra/util/database/DomainObjectLockHold.java