Always clone cached mediadirs lists, as the caller might be modifying
it.