Removed some legacy code which is no longer necessary.

Also now waiting for the SSH key to be accepted in a loop to prevent
spurious thread wakeups from allowing the program to continue before
the key is accepted.