Cleans up lua references and frees buffer memory
Fixes issue with inability to send two frames