Update IPC locking functions to automatically relock for writing and update the endpoint status, if necessary
Add lots of extra ugly, bulky, duplicated IPC locking functions.

Plan to get rid of duplicate code once pipelining is done.