Fix warning: reference to free variable `autopair-mode'

The free variable `autopair-mode` is referenced in `autopairs-global-mode-emacs24-hack`, so `autopair-mode` should be defined before the hack.