clean PATH entries ending with /, fix #2826