Thai king leaves hospital to head to seaside palace