translator: Refactor translate_lval to accept two additional arguments

Will be useful for (un)lockvar implementation
translator/lua: Add :(un)lockvar support