ast: Fix use of read-write lock on LAST tables

Correct usage of the read-write lock that is used to serialise
access to the table of cached LAST values. This bug could
cause occasional problems where an AST pointer would became
invalid for no apparent reason.