narrowrevlog: replace AssertionError with ProgrammingError

Authored by durin42.