rcat: fix leaks (call dereg mr, pthread create detached)