Pop star Robbie Williams has confessed he was "unable to leave the sofa" for three years as he battled agoraphobia.