Merge changes I6d73bcad,I41775eb1,I53342db7,Id8046a4f

* changes:
  gen_constants: rewrite sed to be a bit more readable
  gen_constants: combine sort|uniq
  gen_constants: simplify grep by using ERE by default
  gen_{constants,syscalls}: fix sed/grep locale issues