Fix in error code return when listing dir without permissions