Add additional check to ensure wineserver doesn't crash if mem_alloc fails.