When changing mode, also program frame length, coarse time,
and gain so it can keep the same exposure value. Without this
API change, exposure time and gain will be reset to the default
values in the mode table and the image brightness may change
suddenly.
Change-Id: I82fe8a7d838a041b27af7dd6b9b3d27030318456