[Graph]: avoid using set_flag to much.
[Graph]: avoid using set_flag to much.

atomic_flags::set_flag() is much more expensive than test_flag(). In the
case that a flag is set many times, it's cheap to test the falg with
test_flag() and set it if it's not set yet.

icoming/FlashX,icoming/FlashX,zheng-da/FlashX,silky/FlashGraph,silky/FlashGraph,zheng-da/FlashX,silky/FlashGraph,silky/FlashGraph,flashxio/FlashX,icoming/FlashX,icoming/FlashX,icoming/FlashGraph,flashxio/FlashX,zheng-da/FlashX,zheng-da/FlashX,icoming/FlashGraph,flashxio/FlashX,flashxio/FlashX,icoming/FlashGraph,icoming/FlashGraph,flashxio/FlashX,silky/FlashGraph,icoming/FlashX,icoming/FlashGraph,flashxio/FlashX,zheng-da/FlashX