properly handle StackLayout size_hint and spacing

Makes `StackLayout` take spacing into account when computing the size of `size_hint`ed children in the constrained direction. Also clamps computed sizes to prevent negative dimensions which cause funky UI bugs, and fixes #2750.