w32: Fix memleak in an error code paths.