lua : fix compilation in c++ mode
lua : fix detection of read-only types