Add some tests for internal error handling

Includes a minimal File::Which mockup to simulate a not installed
lsof.