Dirichlet problem for the constant mean curvature equation and CMC foliation in the extended Schwarzschild spacetime