replace #elif macro with #else + #if

Some compilers (at least some versions of GCC anf MinGW)
are confused by combination of #elif with boost magic.

I replaced #elif with #else #if ... #endif

See discussion of this bug where luabind was mentioned:
https://svn.boost.org/trac/boost/ticket/6631#comment:4
change code using LUA_GLOBALSINDEX compatible with Lua 5.2

LUA_GLOBALSINDEX was removed from Lua 5.2
In most cases code using LUA_GLOBALSINDEX was replaced with
lua_getglobal and lua_setglobal.

Current variant compiles with both Lua 5.1 and Lua 5.2.
fallbacks for lua_getfenv, lua_setfenv in Lua 5.2

lua_getfenv and lua_setfenv were removed from Lua 5.2.
Current variant compiles with both Lua 5.1 and 5.2.
change call of lua_resume in Lua 5.2

In Lua 5.2, lua_resume() gets additional argument.
The code was changed to compile in both Lua 5.1 and Lua 5.2.