fix bitmap header struct

Using a structure to save bitmap header directly needs a packed struct,
otherwise the size of struct will be incorrect, and data will be saved
into alignment holes.

Additional autoconf macros are written to test support for
__attribute__ syntax.