regcomp.c: Remove obsolete code

Commit cd209d9d0a3b8eec779c744b3a98c9101e3f1a21 changed things so that
this code (as its comments suggest) is now obsolete.
regcomp.c: Move code into a function

This is in preparation for it to be called from another place
regcomp.c: Change a panic into an assert

This really should never happen, so might as well be an assert.