Replaced fcntl(3, F_CLOSEM) with closefrom(3)