advapi32: Free wstr in error case to avoid leak (Coverity).