Add AllowInvalidPlacement check to IsCellBuildable.

Fixes #5902.