Security fix: source/librpc/gen_ndr/ndr_wkssvc.c

Manually applied from samba-3.0.37-CVE-2012-1182.patch
Also combined loops while I was at it.  Let the compiler make these speed for size optimizations.