C++: Collected small fixes

Minor improvements to the code and cmake build.

--------

Testing:

The small cosmetic tweaks won't really be tested by the CI builds except to confirm they build.  However, the IFD and PNG changes will be.  All jobs should remain green:
http://ci.openmicroscopy.org/job/BIOFORMATS-5.1-merge-cpp/