More robust timeout, better line reading

Now it'll request an xterm shell as a normal user would, also timeout is independent of the server sending content or not.