[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?
I think this outer loop is actually the one that is the anti-pattern.