Rethinking Goal-conditioned Supervised Learning and Its Connection to Offline RL