core: Add missing mutex acquisition when manipulating active_contexts_list

The `active_contexts_list` is supposed to be protected by the
`active_contexts_lock` mutex.

Upon code review, found one place where the mutex was not acquired.

Closes #1413
2 files changed