Force allocating a TTY when sudo-ing remotely

This is necessary to use passworded `sudo` or when the `requiretty` sudoers option is enabled.

Based on <http://serverfault.com/a/348756>.