Fixes issue where it would attempt to free an already invalid host handle