Add missing stdbool.h header in self_test.c

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Minor improvements to return code handling

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Remove dead code in diagnostic_data.c

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Split debug dump frame acquisition into separate function