Add mutex while scanning for hosts