Avoid duplicate extension in nbconvert

nbconvert --to notebook --output Output.ipynb

would write Output.ipynb.ipynb before this PR
test `nbconvert --output` with and without extension
Merge pull request #6067 from minrk/output_prefix

Avoid duplicate extension in nbconvert