Update media debugging.

This fixes some bad handling with non-newline-terminated files, and extends
the test to cover both cases.