The Princess of Wales was greeted by shouts of "we need more funding" from women inmates as she visited a prison's mother and baby unit.