Also add missing unique_ptr tests for Lua and Racket.
This is a test added for D in previous commit, now expanded to all target languages. Tidy up counting object instances.
Equivalent to Ruby/Python implementations.