Replace header() with Common::sendHeader() when possible

Issue: https://github.com/piwik/piwik/issues/6184
I did this one without edit View.php because it broke some test. I will push after that.