Qatar's former emir returns home to attend funeral