Fix lambda initialization.

- Lambda was initialized before slice type was set in encoder_control.
Simplify scan mode selection.

- The scan mode selection for chroma was a bit complicated so I checked it
  and it was all unnecessary. The mode selection is the same as for luma.
Take intra mode based coeff scan mode into account for coeff bit cost.

- Previously only diagonal scan mode, the most common one, would be used.

- This improved bdrate by 0.1-0.5 % for p0 and 0-0.2 % for p60.