Hi,
I don't know if this thread is still relevant, but the simplest solution is to just invert the bars when building the Detolf.
This prevents your dwarf from being able to squeeze inbetween the glass walls and the short bars.
The long, horizontal bars are nothing to worry about in the first place.