core.c: Add mutex for synchronizing distribution tree member lists access

Member lists may be accessed from 2 threads: upstream and
extract, therefore mutex should be hold each time one of
the lists is accessed.

If the lists are accessed during distribution tree dump
to log so only a try to take a lock is done, and if it
is not successful then another try will be done on next
subnet up event.

Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>