Fix syntax error
Simplify code and fix system notice in Timeline

Notice was triggered when avatars are disabled due to a strict-type
comparison (array() !== false).

Fixes #17492
Fix 'Undefined index: _stats' notice in bug API

This is a regression introduced by a change in filter API by commit
5458f7020999317b35f403fa2a0e477d6182ec12. In filter_cache_result(), the
2nd param to bug_cache_database_result() was changed from 'false' to
default (null). Consequently the '_stats' element was no longer present,
triggering the notice.

Problem solved by relying on array_key_exists() instead of is_null() to
check for the '_stats' array element.

Fixes #17494