Add method to clear context from thread storage

As per @artgillespie's original PR in #401, sans the unnecessary merge commit.