Boundary conditions in the stepwise sine-Gordon equation and multisoliton solutions