Fixes and adjustments in platform agent

These commits should fix some of the recent breaks exposed on the buildbots.
Note, there's still a "fail to start port agent" kind of error that is most likely caused by a prior failing IMS.stop_instrument_agent, which seems related with recent changes in the handling of process_ids.  But please merge while we investigate.   Thx.