use directIO flags when dd'ing template

This makes sure dom0 in xenserver doesn't get hammered
when copying templates. It doesn't make sense to use
the cache of dom0 as the template does not fit in
memory. The directIO flags prevent it from trying.
Fixed few coverity issues
Merge branch 'master' of https://github.com/remibergsma/cloudstack