Fix bug in command listener premature exit bug

The bug was introduced in 0722e24ed229beab7126f511eccf6aa469512da3, in
which the loop around poll() was removed.  This could cause premature
exit of the local command listener.
Sync version tag 1.0.9.