Memory functions improvements: Make style homogeneous.

`try_malloc` was changed in 8bb2c2c0742c57150655e18cf8418a758cebdce8 to
avoid a warning when size is 0.

Code style was also improved on suggestion by @aktau.
This just applies the same style improvements to other similar
functions, to keep code homogeneous.
I wondered the same some time ago. Note, though, that this has been working a long time without problems (I mean, this PR doesn't change that, it was already so).

But going back to your question, I think the following:
- Regarding executing code at runtime, function attribute doesn't affect. Allocation remembers its size, and free will act consequently.
- Function attribute should affect only in static analysis, if it detects we try to access more memory than allocated. Then, the only case where we change params is if one of them is 0. And in that case, we shouldn't dereference the returned pointer in any case. So, if we do dereference it, and analysis warns us because accessing more of theoretically allocated size (0), it would in fact be signaling something we shouldn't be doing.

So, I see no harm in that.