Correctly end output buffering before calling readfile().