Martini middleware to extract or generate a request id.