Fix checksums-out command (RHBZ#895904).

This was broken by the earlier
commit 0306c98d319d189281af3c15101c8d343e400f13.

This commit also adds a regression test.