MDLSITE-2127 Do not use trailing slashes for $excluded_list

Recently a bunch of utilities (phpcpd, phploc) changed to
Symfony's Finder that does not allow trailing slashes at the
end, so we are trimming all them for $excluded_list that is
onlu used by those utilities.