Update middleware.py

Fixed reading the request ID from META dict.