Prevent calling CGI.escape on a SafeBuffer

I don't know if this is the right place for this but similar to this issue: https://github.com/rails/rails/issues/1555 when the `CGI.escape i.to_s` call is made and `i