Add thread assertion to proc_set_last_status
Fix for issue where a file may be incompletely read on receipt of a signal.