Fix attaching to console on Windows

Commit e68390254c8 was incomplete in that it didn't redirect the streams
properly. This commit fixes the case where the application is launched
from the console, but output is not redirected.

In addition, redirection of stdin was removed. We don't use cin anywhere.

Change-Id: I25dcde106d598ec1db6f2737312ce542438af0c9
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>