Improve context.set_ctx to not fail

* it will now not fail in case of trying to delete empty ctx

Change-Id: I564819ac942c8f611fade73c7915c73aa3b0aeea
Merge "Improve context.set_ctx to not fail"