Thanks, I reproduced the problem and installed the following patches. The first should fix the bug. The second should fix some display glitches I noticed while fixing the bug, where emacsclient wrote to the terminal even though it was started with a trailing '&'.