Make various variables read-only (const)

https://commitfest.postgresql.org/action/patch_view?id=1356
http://archives.postgresql.org/message-id/52C612B1.5080706@omnigroup.com