Correct reading of game files from non-rewindable istream in command line.

On platforms where stdin could not be rewound, reading a game file from
standard input was failing in the command-line tools.

This adjusts the implementation so that the stream is read first to a
local buffer, which can then be rewound if required on a parse error.