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.