Prevent NPE when closing after open failure.