add demand dialling support; rename fd to ttyfd