detect master with background thread (fix ros-visualization/rqt_common_plugins#169)