fix the error to appear after printing the encrypted PDF

See: http://d.hatena.ne.jp/takeshinoda/20130129/1359471220

http://osc.matsukei.net/issues/409 fixes #409
fix PDF file is not created correctly in test:case