Replace gensub for compatibility with gawk2 (PR 351).