Replace use of (v)snprintf with (v)asprintf. This has several advantages:
1. (Mostly) easier to program with as the allocation is done for you.
(Sometimes it's a little more complicated to get the deallocation
right). The amount of code removed as a result by this commit is
greater than the amount introduced (excluding the (v)asprintf
implementation).
2. Safer: no buffer overflows.
3. Works on all platforms: BSD-licensed mature xnprintf code used
(I've been using this for some years in Zile with no problems). No
more overflows due to the previous bogus snprintf/vsnprintf
fallbacks.
Also add and use a MAX() macro in the same vein as MIN().