Enable building with Microsoft Visual Studio 2012.

Backpatch to release 9.2

Brar Piening and Noah Misch, reviewed by Craig Ringer.
Merge branch 'master' of /home/kgrittn/pg/postgresql into matview