Detected GNU vs BSD stat more effectively.