properly decref the return value of close()