Using mutual information to measure time lags from nonlinear processes in astronomy