If your polygon has uniform z values you could just edit the geometry engine's output like this: JS Bin - Collaborative JavaScript Debugging
If your polygon has varying z values it's a harder problem. I'm not really sure the right way to approach it, but the geometry engine doesn't appear to have a solution built in. Convex hull looks like it respects z values, but it returns the smallest possible enclosing polygon rather than a buffer.