use the proper S_ISLNK macro to test st_mode

Fixes #18