Add timeout for cursor operations

Changes like in #48 from @amanciodiaz, but with timeout value in application config.