Storage and reproduction of an ultrafast optical signal with arbitrarily time dependent wavefront and polarization