ismindex: improve diagnostics

This improves error messages for completely and somewhat broken inputs.

Signed-off-by: Martin Storsjö <martin@martin.st>