Fix: libreplace: closedir when bailing out dir traversal
replace comma operator for more consistent code