Get format for negotation from the correct request attribute

In the case of exceptions, content negotation isn't properly
being passed the right format.  This is a workaround until
symfony/symfony#8778 is merged.