Move to smart pointers for refcounting RS contexts

Change-Id: I0dc6adc4e02c7427a4234c549d3555a501fe5f90
17 files changed