Fix some Cppcheck complaints
Check for alloc_size compiler attribute

If it does not work, do not use it.