Fix build on systems where default lua is 5.2

Currently, if a system has both lua5.1 and lua5.2 installed, but lua5.2
is the default, the build tries to use lua5.2 instead of lua5.1 which is
currently not supported.

BUG=https://code.google.com/p/ibus/issues/detail?id=1581

Review URL: https://codereview.appspot.com/7223049
Patch from Nuno Araujo <nuno.araujo@russo79.com>.