Consolidate Linux and OS X versions of getStackSymbols().