Lock license key row when selecting license keys for update.

There are instances where two processes in parallel can try to get the
same license keys. By locking the rows when selecting, we should be able
to avoid this.
Merge pull request #2 from degica/double_assignment_bug

Lock license key row when selecting license keys for update.