removed a wrong and redundant call to pthread_unlock()

+ minor cleanings
bugfix: ensure matching exactly the basepath and not only partially