commit.c: check for lock error and return early