added explicit "wssocket.writeHead()" tests

These test check the behavior of "writeHead" (e.g. validation, auto flags).
Also I rewritten the structure of the write_head.js test to match the api better.