Removed State from DevicesTable
Database thread safety

- Added lock statements while accessing the database to provide thread
safety
Revert "Database thread safety"

This reverts commit 053bb8af54651663cbb919481d7bd16e3b636c87.
Database Thread Safety

- Two lock objects were created
- LoginTableLock locks the operations on the login table
- DbWriteLock locks the operations of adding new devices or users
- AddNewUser() and AddNewDevice() were changed so that they return the
assigned ID to avoid conflicts