Correlation between intensity noise and longitudinal modes of a semiconductor laser coupled to an external cavity