BF: Fix is_dir/is_file for symlinks (Issue #4) in Linux

We need to do an os.stat call for symlinks to see if they point
at a file or directory. I am not sure if there is a more efficient
way to do this in windows.

I went ahead and added caching of the os.stat result too.