Probably, a little bit late... But better late than never.
Well, I met the same problem almost 2 years ago within Moodle 3.1.
Than updating to 3.5 did not resolve the problem, neither to 3.8.
Finally, putting a lot of code catching the output buffer (i.e. PHP function ob_get_contents), I found an extra space in one of my customized plugins (file my_customized_plugin/db/events.php):
So when Moodle executes something like this :
the function include() grabs this extra space and put it in output buffer, just before headers.
This is why ob_clean() can sometimes hack ; but the real problem is bad code in third-party plugin :