Improve resizing and freeing of res_remt. Start work on release
of remote allocations.