Refine half and bool compatibility.

Use __fp16 for half if available.
Use <stdbool.h> for bool.