Work around midi library bug

Apparently Load.maybeFromByteString can sometimes throw an
exception from a Data.Binary function even though it's supposed
to encapsulate all read errors into a Left value. So instead
we just look for the MIDI magic number at the start of the file
and choose m->t or t->m based on that.