Fix ssh keys files being emptied when disk is full.

Check that the disk has enough space (size of the ssh keys file + 1MB) before
attempting to move the temporary file to its final destination.
Tested on Debian and CentOS.