Spy on ipc.send and make it synchronous