VCL: Fix error handling during heap alloc