Fix compile warnings when defining -DDBG_LOCK