Simplified implementation of lock-guarded access to connection's output.