Call WriteFile even for empty messages

This is necessary to avoid hanging in the corresponding ReadFile calls.
Before we kept the engine connections open, this just caused threads to hang
indefinitely. Now that we're using just one connection, it causes the whole
tab to hang indefinitely.