Sexual relationship between pastor, gunman’s wife being investigated as motive for shooting