Fix export of xfig external insets (bug #9244).

The check for a latex format is very fragile. Both libmagic and our
guessing from contents cannot distinguish the pstex and pdftex formats
used by the xfig external inset. Moreover, it may also happen that
lyx files are mistaken as latex ones. Thus, when the guessed format
is latex, the only solution is to give precedence to the format
determined by the file extension.
Merge remote-tracking branch 'github/build-bot-2.1.x' into bleeding-edge-2.1.x
2014.09.28-20.00