Improve leaked resource logging messages

The simple class name for anonymous classes is an empty string, which
happens to be the most common use case for us. So keep walking the
class tree until we get a meaningful class name.
Add the id of the leaked object to the output string.
Correctly implement the Closeable interface

It's ok to call close() on already closed instance.
Merge pull request #10 from tambeti/fixes

Fixes