Fix `npm ls` with --depth=x option

There are currently two issues when using `npm ls` with `--depth=x` option:

1. Unmet dependency with depth that equals maxDepth is missing the "UNMET DEPENDENCY" label, and the error output has message "max depth reached" instead of "missing".
2. Met dependencies with depth that equals maxDepth also output error, with message "max depth reached". (just try `npm ls -g --depth=0`, also see #2843)

This commit should fix both.