make getting stdout fileno cross platform. fixes #38