Add mutex to while scanning for hosts