Fix off-by-one errors in registers

Reported by Florian Weimer.
https://bugzilla.redhat.com/show_bug.cgi?id=959215
m2ts_filter.c: include config.h