[MediaController] Add locks for variable used in different threads