Rack middleware to prevent timing attacks