GOPlan: Goal-conditioned Offline Reinforcement Learning by Planning with Learned Models