D.Compat.CreatePipe: use locale encoding

Issue #1895. `createPipe` opened handles in binary mode by default,
which mangles text encoded for the current locale. Now, `hSetEncoding`
is called on the new handles. This requires `base >= 4.2`.
Unit test to check locale of handles created with `createPipe`
Merge pull request #2011 from ttuegel/create-pipe-encoding

D.Compat.CreatePipe: use locale encoding