(PUP-3604) Rework handling of :ensure with a version

But that would end up with 'foo-1.0-'  if no `@resource[:flavor]` because it's not `nil` but an empty string.
Using something akin to:
```ruby
[ @resource[:name], use_version, @resource[:flavor] ].reject { |n| n.empty? }.join('-')
```

won't work either, since we lose information when `use_version` is empty, but `@resource[:flavor] isn't as we're going to end up with `bash-static` instead of `bash--static`.