add hash_compact function

When wrapping a resource in a defined type, it is extremely useful
to be able to accept the same parameters as the wrapped class. If
the parameters are optional, it is necessary to remove the keys
with unset values from the hash, because explicit `undef` values
will overwrite defaults in the wrapped resource. For example, in a
situation where resource defaults have been set like this:

    Wrapped {
      extra => ['--some-option']
    }

Here is a wrapper that overwrites default values:

    define wrapper($name, $extra = undef) {
      wrapped { $name: extra => $extra }
    }

And here is a wrapper that does not overwrite default values:

    define wrapper($name, $extra = undef) {
      $options = hash_compact({extra => $extra})
      ensure_resource('wrapped', $name, $options})
    }