ensure releasing the context when clearing a redis connection

and properly init/dispose the spin lock if necessary