Speedup profile creation

Use os.access() to test if the directory can be read. The `listdir` approach is
very slow.

Fixes #237.