Fail with a better error message in multiswitch
Swap out using a while read loop for using maplines in __check_all_deps.

For whatever reason, the while read loop awas leaking file descriptors
like crazy, and the mapfile based code does not.