Move version check to hpp from cpp

We should check MySQL version and define logical flags in hpp and use
them in cpp. It improves maintenability.

Some flags are used in two or more locations. If they are used in two
or more locations, we need to write the same version check conditions
there. It reduces maintenability:

Not good:

    #if MYSQL_VERSION_ID >= 50607
      // code1
    #endif
      // ...
    #if MYSQL_VERSION_ID >= 50607
      // code2
    #endif

Better:

    #if MYSQL_VERSION_ID >= 50607
    #  define LOGICAL_FLAG
    #endif

    #ifdef LOGICAL_FLAG
      // code1
    #endif
      // ...
    #ifdef LOGICAL_FLAG
      // code2
    #endif