bsd-uthread: Use ptid from regcache instead of inferior_ptid
This is one of the rare to_fetch/store_registers implementations that will
still rely (for now) on inferior_ptid (because of the memory read/write
operations). We therefore have to add a save/restore of inferior_ptid. We'll
be able to remove it when we make the memory operations accept the ptid as a
parameter.
gdb/ChangeLog:
* bsd-uthread.c (bsd_uthread_fetch_registers,
bsd_uthread_store_registers): Use ptid from regcache, set and
restore inferior_ptid.