Discrimination of arbitrary unknown quantum channels and measurements