add thread safety to rack middleware via self.dup.call