Nicola Sturgeon did not break the ministerial code over an investigation into complaints against Alex Salmond, an investigation has concluded.