Add openGrab, closeSync and writeSync methods

Allows more robust open and synchronously cleanup when process is
shutting down