Fix monitor-resurrection test.

Try to avoid the pinning of the object that needs to be finalized.