SurfaceFlinger: Use traversal functions to iterate LayerList.

In preparation for the Layer hierarchy. There we will need
to use such a style to traverse the tree of layers.

Test: Just a refactoring. SurfaceFlinger still works.
Change-Id: I84dcd82e713f1bdbe911658793ce11460267a956
7 files changed