[RFC] Refactor buflist_findpat "two-iteration loop" anti-pattern

Another occurence of Issue #572. This code is much clearer but longer.
Couple of questions though:
* line 1731 - 1750: Even though the code is clearer, this still looks like something that should be replaced by a for loop?
* The infinite for loop (line 1730) could be replaced either by moving the above mentioned code into another method, or by using a goto statement (gasp). Would the first be preferable?
Won't we always hit this if statement if we previously set the match? At which point we would overwrite the match to `-2` and never return anything valid?