This back-ports ssh_get_shell implementation from devlib. It includes
the following changes:
- original_prompt for Telnet verison of the connection can now be passed
as an argument.
- Multiple attempts to connect with a timeout.
- Some additional implementation to the tty, including setting the size.