pshared: Improve mutex_init_pshared_with_type()