[runtime] Remove unneccesary locking from some metadata functions.