Make sure actors are removed from control groups when captured

Fixes #5976.