Handle multiple calls to close().