On the closedness of the linear image of a set with applications to generalized spline functions