make `collect_deprecations` available.

There are circumstances where the capabilities of `assert_deprecated` and
`assert_not_deprecated` are not enough. For example if a ccertain call-path
raises two deprecations but should only raise a single one.

This module is still :nodoc and intented for internal use.

/cc @rafaelfranca