path: fix folders returned by find command
redirect errors in function get_build_dir()