[5.0] Clean up cookie queue middleware

- Unused namespace import
- One-line control statement without braces