Implement "safe mode" for icinga::Deserialize.

Fixes #5035