Move common checks to a static method `ShouldInterceptWriteForFildes`.
Move common checks to a static method `ShouldInterceptWriteForFildes`.

PSPDFKit-labs/xctool,AutoScout24/xctool,facebook/xctool,PSPDFKit-labs/xctool,LegNeato/xctool,dvor/xctool,LegNeato/xctool,dvor/xctool,yaoxiaoyong/xctool,LegNeato/xctool,facebook/xctool,yaoxiaoyong/xctool,dvor/xctool,PSPDFKit-labs/xctool,adamjernst/xctool,facebook/xctool,LegNeato/xctool,dvor/xctool,facebook/xctool,adamjernst/xctool,AutoScout24/xctool,AutoScout24/xctool,PSPDFKit-labs/xctool,AutoScout24/xctool,yaoxiaoyong/xctool,PSPDFKit-labs/xctool,facebook/xctool,yaoxiaoyong/xctool,adamjernst/xctool,adamjernst/xctool,facebook/xctool