Drop privileges before creating and chmodding SSH keys.
Previously, potentially abusable chown and chmod calls were performed as
root. This tries to moves as much as possible into code which is run
after privileges have been dropped.
Huge thanks to Ricky Zhou <ricky@fedoraproject.org> for discovering this and
supplying the security fix. Awesome work.
Fixes CVE-2011-3870
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>