Don't inherit stability to items in a function body.

Items defined in the body of a function has no visibility outside it, and thus have no reason to inherit its stability.

Closes #17488