Refactored Pulsar Producer bridge to avoid leaking resources during crashes.