Flex: be more permissive in parsing IFDs and XML

This allows a trailing ">" in the XML block, in addition to forcing more
thorough IFD parsing when the images are stored before the IFDs.

See
http://lists.openmicroscopy.org.uk/pipermail/ome-users/2014-January/004164.html
Merge pull request #886 from melissalinkert/flex

Flex: be more permissive in parsing IFDs and XML