builtin/grep: make lock/unlock into static inline functions