TS-1857: the Lua plugin is built whether Lua is found or not

Autoconf 2.59 seems to have a bug where AS_IF constructs with
multiple conditions are not emitted correctly. It only emits the
first condition and the final else clause. Fortunately we can work
around this by using a switch statement.