FFI: fix the job leak under heavy load