enc_qsv: cleanup encoding loop, part 1.

Mainly:

 - allocate frame surface data in qsv_enc_init
 - setup input frame surface outside the loop
 - remove unnecessary variable
 - handle errors via a common path