Dynamic melting of confined vortex matter