fix count_lines so that pushd is silent