Fixed handling of invalid files

* (There should be) no memory leaks when a track is found to be invalid
* Error when it's not possible to read the amount of bytes specified by
  a track header