Bugfixes, SQL improvements

Fixes bugs in bootstrapper and headless state detection.

Also adds automated cleanup for SQL query result sets generated by the
managed methods of Arpk::Database.