Type guards should not affect values of type any

This PR changes type guards to not affect values of type any.

Fixes #1426.

Why doesn't getNarrowedTypeOfSymbol call isStructuredType? Instead it checks the flag directly