Add timeout to resolve row lock bug

Simultaneous access to a row when writing and reading will cause an exception. This allows the proces to wait until it's available and then write instead.