cmake: fix auto-link issues with MSVC

If you tell MSVC to link with the static lib, the dependencies somehow fail and
x265.exe is not re-linked properly when the static lib is changed.
common: add CHECKED_MALLOC macro that logs malloc failures and jumps to fail label
encoder: Do not use X265_MALLOC use CHECKED_MALLOC

Currently X265_MALLOC did't validate the returned pointer, CHECKED_MALLOC Always
validate the returned pointer and print the Log message and jumps to fail lable
if returned pointer is not valid,
Bug Fix - copy last Recq value to thread local rce object

Missed this out in previous patch.
encoder: style nits, no logic change
Merge with stable