Store is_locked status in SQL.

Change-Id: I8014b269f900596bfa51f13bdb9f4bd29bad8803
Store shell in SQL.

Change-Id: I6b1fc74f39fe89067af48df855df0d781ec26c85