Fixed returning freed memory after failure.

Problem was in sgSurfaceCreateTexture().
Fixed sets again; hopefully for real, this time.

Bug is/was present when inserting an already-present item
into the set.