Flex: be more permissive in parsing IFDs and XML (rebased onto dev_5_0)



This is the same as gh-886 but rebased onto dev_5_0.

----

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