swresample/rematrix: fix update of channel matrix if input or output layout is undefined