alloca() is declared in stdlib.h on BSD systems

... except on Darwin.

Bonus change: Updated auto-tests trying to include 'alloca.h'.

This is a follow up on 24c43a5748b8502.

Change-Id: I299de00bf0dca7842470b158282daea221a10f2d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>