Various assorted fixes

Here are various assorted fixes.

Feel free to cherry pick if not convinced by some of them.

Most of these fixes are for minor cosmetic issues or very minor performance improvements.

There is one bug though:
https://github.com/openwide-java/pgjdbc-ng/commit/dbba49971f08ca484a47172d3aebc5bcf3fcf391