improve pty handling

Always run dpkg in a pty. If there is a controlling terminal already
forward the input to dpkg. This ensures that we get a terminal log
even if stdin/stdout/stderr are redirected