configure: Move log2 dependency declaration to a place it takes effect

It was incorrectly moved in c869fcdeac3b7cd71a852b928902daadeca55685.
alsdec: check block length

Fix writing over the end

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Addresses: CVE-2013-0845