Closes the datatype referenced by type_id. Returns a negative value upon failure, otherwise the operation was successful.