Fix if exist query on pandoc path
- os.stat raises an exception if None is provided so double check it