[media] stb0899: move code to "detach" callback