Support for multi-threading added

Each thread encodes one SB row concurrently.
Following are the performance improvement ratios
  Basketball, 1080p, 3000 kbps, for --rt, --cpu-used=5
    Two threads -- 1.7x
    Three threads -- 2.3x
    Four threads -- 2.6x

  gipsrecmotion, 720p, 1000 kbps, for --rt, --cpu-used=5
    Two threads -- 1.6x
    Three threads -- 2.0x
    Four threads -- 2.2x

NOTE : Loop filtering and bitstream packing still runs in a single thread
NOTE : When "adaptive_rd_thresh" is enabled, encoder runs in single thread