Refactor devicelock related boot state query, and move it all
to its own dedicated file.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>