fix threading bugs

Fix locking of data structures shared across threads.

Fixes https://github.com/ros-visualization/interactive_markers/issues/15