Gate-controlled rectifying barrier in a two-dimensional hole gas