Fix ios sound player crash on exit

ref #1857