CHEF-4662: fix insecure knife tempfiles

this is a rebase of the changes to master onto 11.8.0-rc candidate