Ensure that local and remote keys have secure permissions - fixes 382

Merge after #403

Fixes #382 
This happens post-facto. Thus fixes the issues where openssh client refuses to run, breaking cross-node communication, but it still leaves a window during which an attacker could steal the key. An appropriate call to `umask` before the files are created should fix that.