Check REQUEST_CONTEXT.context exists before accessing it.

LMS-11226
@adampalay I like the patching example. Because even if the first way works I think it's preferable to be safer and also easier to read for the next person who comes along.