mark the 'ctx' variable as volatile

this should avoid compiler optimizations that might interfere
with the garbage collector later