Use -1 instead of 0 to represent an invalid descriptor so that modlib_uninitialize doesn't try to close the descriptor 0.