MAINT: signal: remove K&R-isms

Code was (1) mixing C89 and pre-standard syntax, (2) not including
<stdlib.h> and casting the return value from malloc (thus implicitly
relying on other headers to include this on 64-bit platforms) and
(3) using int instead of size_t for memory buffer sizes.