LOCK_ENTITY structure correction

This pull request updates the LOCK_ENTITY structure handling to match that described in 1722.1-2013.

Also had to comment out what seemed like an out-of-order #include...