Fix #49

Ensure that the encoder knows when it was responsible for starting the
camera's capture and that it only attempts to disable capture when it
was responsible.
Added tests for #49

Also tidied up the test structure including factoring out image
verification and placing all verification routines in a common module
(so that things like test_split_and_capture can access them)
Merge branch 'master' of github.com:waveform80/picamera