Fix problem with subshell in unless command

With puppet 3.2.2 this gives an error as the default
provider of POSIX doesn't expand the subshell $()
Provide backward compatibility with puppet clients < 2.7