Check that the cellar exists in Formula.installed

Fixes #21741.