Fix bug in lock() which was causing it to wait on an uninitialised channel when node doesn't exist.