Sets value to false and closed to true. If overridden, should set closed to true and call onClose if used.
Returns the value of closed before closing or null.