Use AllocateFile and stdio to reduce mechanism

Mostly to take advantage of sscanf and get out of the business of
directly manipulating StringInfo.

Per review by Peter Geoghegan <pg@heroku.com>
Remove superflous whitespace