song: add a test for the replay-issue fix in prev commit

Also fix a leak in the test suite.