reducing number of process calls

Calling getcwd() or cwd() too soon leads to an error, as it requires you
to have corresponding permissions. Those special contents are not
required for filtering the processes, so they are computed/cached
on-demand.