Solve Exercise 5-13: tail

This exercise was somewhat irritating until I caved and used the code in
section 5.6 like the exercise suggested. The solution is not what I
think is clean, but given that [mc]*alloc haven't been covered yet, it's
probably the best one can muster.

Once I used the code in §5.6, the program fell into place. Still, it was
a neat exercise.