Improved the new pending command factory interface and usage in
connection to support scenarios where no commands are produced.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>