Add an :munge_undef argument to functions

  :munge_undef takes two possible values:
    :empty results in munging `undef` into `''`
    :nil   results in munging `undef` into `nil`
Use :munge_undef in hiera functions (fix bug #13210)