cmd/5l, cmd/6l, cmd/8l: refactor stack split code

Pull the stack split generation into its own function.
This will make an upcoming change to fix recover
easier to digest.

R=ken2
CC=golang-dev
https://codereview.appspot.com/13611044