Add a missing sys/stat.h include for FreeBSD to declare umask().