FIX: Improve invalid frame detection code.

Improve detection of invalid AMQP frame header before allocating frame buffer.

This fixes #187.

Thanks to Mike Stitt <mikes@spindance.com> for the inspiration on this.