Issue #2359509 by Berdir: Incorrect type safe check in Entity::onUpdateBundleEntity() results too many cache clears