mdot: remove unused `time` import
mdot: remove functools import.

Functools was needed for the unoptimized version of multi_dot.
mdot: fix imports of _multi_dot_matrix_chain_order