BLD: fix path handling, and possible import surprises in test_perf