libctdb: use magic to detect free/invalid locks