rest compiler for code-blocks: rstrip() last chunk of the input

When I compile

    .. code-block:: console
    
       $ echo "test"

It's compiled to quite unattractive construction (mind trailing \n)

    <pre class="code shell literal-block">$ echo "test"
    
    </pre>

This minor patch fixes it