threading: recover include of unistd.h within #if __GNUC__ section

Fixes MinGW build