epmd: Fix -names option on Windows

Since 3aa60cc `epmd -names` does not produce any output on Windows
anymore. This patch uses fwrite() instead of write() which adds the
necessary carriage returns to the output so that it is suitable for the
Windows cmd.exe.

A test case is added (fails on Windows without the patch).