test-ls.sh: get the symlink mode from the host ls; test for subcmd failure.

This should fix a failure on OS X where symlinks don't have a
"rwxrwxrwx" mode like they do on Linux.

Thanks to Sashka Will <will.sashka@gmail.com> for the report.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>