lib/util.c: introduxe xstrdup which catches NULL and use it in all places