ls: Do not show deps of extraneous deps

Fix #6064
read-installed@3.1.1

Properly handles extraneous dev dependencies of required dependencies.