add a lock to g_on_r_interaction to make helgrind happy

its probably not actually needed
api test is helgrind clean

had to increase the time before the child process 'types' exit
into the test shell because helgrind is so slow and we were
exiting before all the tests could finish