commit_lock_file(): use a strbuf to manage temporary space