Handle the case of zero length in WSTR(DWORD) (ref gh-41).
Fix handling null pointer and zero length (close gh-41).

  - Assuming the null pointer is passed with zero length.
  - It has been ensured by WSTR not to write to a null pointer.
Re-apply patch to perlglob.c though it is not affected to actual products.