There’s an -ign_eof
option which does exactly what you want without any hacks. It’s been in the codebase since 2000 (0.9.5a), apparently.
The option suppresses the special interpretation of Q and R, and ignores an EOF on stdin. Instead, it waits for a connection close.