Add function guards on cowboy_req/header/2+3.

This patch type checks the Name variable to ensure that programmer errors are better reported.