This modifies the private interface a little so if
people have custom subclasses, it will require them
to modify their _record_ending function to take additional
arguments. Afaik, we're the only ones insane enough to
do such a thing and we're ok with the change.
Change-Id: I24444d65a566023afcd1546e4f784ecae36d6126
Fixes: #1510248