Optimize performance of Buffer#line_begins

Replaced `push/reverse` with `unshift`. This is generally about 10 times
faster according to my simple benchmarks.