Simply use Replace
select id,replace(group_concat(val),',,',',') from test group by id
Or you can use IF
select id,group_concat(if(val ='',null, val)) from test group by id
Or You can use NULLIF
select id,group_concat(Nullif(val,'')) from test group by id