Thermally driven cavity flows in porous media II. The horizontal boundary layer structure