Allocate a pty if required