preserve ownership and permissions of existing files

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
create tmpfile on same volume as existing file

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
Merge pull request #205 from asteven/issue/205

__ssh_authorized_keys resets owner and permissions of the ~/.ssh/authorized_keys file when removing an existing/updated entry