Add IS_OLD_RECORD macro
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.

This closes #23

COUCHDB-2511

Signed-off-by: Alexander Shorin <287dfd97d2274fe201ae7191a244ba25e475e13a@apache.org>

apache/couchdb-couch,fkaempfer/couchdb,apache/couchdb-couch,apache/couchdb-couch,cloudant/couchdb-couch,fkaempfer/couchdb,cloudant/couchdb-couch,fkaempfer/couchdb,fkaempfer/couchdb,cloudant/couchdb-couch,fkaempfer/couchdb,fkaempfer/couchdb