Resonant trapping in the transport of a matter-wave soliton through a quantum well