Add IS_OLD_RECORD macro

This can be used in guards to detect if a state variable needs to be
upgraded. An example of it's use might be:

    handle_call(Msg, From, St) when ?IS_OLD_RECORD(St, #st{}) ->
        handle_call(Msg, From, upgrade_state(St));

This is useful for upgrading any of our various gen behaviors that
aren't properly supervised.

COUCHDB-2511
You'll get a false negative if the change to a record doesn't change the size. But in that case you probably need to avoid the use of dynamic code upgrades altogether.