use tee when saving self signed magento certificates

Because of stream redirection it is not able to write magento.key file if ssl directory is owned by root.
One way to solve this is to use tee.