conn: fix WriteCommand locking