netapi32: Fix some limits and bounds checking.