fix initialization bug in ui.c

pipe_mtx was not getting initialized or destroyed