More intelligent handling of disabling and re-enabling the webcam stream.

See #314