Properly closing php://output stream after entity has been sent.