[mcagents] Some fixes and cleanups in sshkey