rpc: Move `rpc:release` method to apply to all object-ids.
Previously this was a method on "Session", and took an object-id as a parameter. Now it is a method you can invoke on any object-id. This approach is probably more sensible.
Closes #1663 (closed).
Additionally, this branch adds tests for releasing objects in the Python RPC code, and fixes issues found while doing so.