Coalesce warnings for deprecated lifecycle hooks and print single message after reconciliation (rather than one per component-type).

Relates to PR #12028 and [this comment](https://github.com/facebook/react/pull/12028#discussion_r162420575).
let didWarnAboutWillReceivePropsAndDerivedState;
let warnOnInvalidCallback;
if (__DEV__) {
  if (warnAboutDeprecatedLifecycles) {
    didWarnAboutLegacyWillMount = {};
    didWarnAboutLegacyWillReceiveProps = {};
    didWarnAboutLegacyWillUpdate = {};
  }
  didWarnAboutStateAssignmentForComponent = {};
  didWarnAboutUndefinedDerivedState = {};
  didWarnAboutUninitializedState = {};
  didWarnAboutWillReceivePropsAndDerivedState = {};
  const didWarnOnInvalidCallback = {};
  warnOnInvalidCallback = function(callback: mixed, callerName: string) {
    if (callback === null || typeof callback === 'function') {
      return;
    }
    const key = `${callerName}_${(callback: any)}`;
    if (!didWarnOnInvalidCallback[key]) {
      warning(
        false,
        '%s(...): Expected the last optional `callback` argument to be a ' +
          'function. Instead received: %s.',
        callerName,
        callback,
      );
      didWarnOnInvalidCallback[key] = true;
    }
  };