The strong clique number of graphs with forbidden cycles