Correct return value checks from opendir calls.