The Magnetospheric Gap and the Accumulation of Giant Planets Close to a Star