Regression test on correct processing of OOM thrown while adding a finalizer reference.