Coverity: Ensure fp is closed along all error paths.