pulse: remove state callback before freeing userdata.