Fixes missing lookup var in ticket lock renews

Rebased (well, rewritten) https://github.com/clonemeagain/osTicket-1.8/commit/9c2d8a0ebdc4ade3003a7df69c9f6cb80839d011 for 1.7

As requested: https://github.com/osTicket/osTicket-1.8/pull/341#issuecomment-31010725

Referencing pull request: https://github.com/osTicket/osTicket-1.8/pull/341