How to replicate getaccountaddress behaviour using getnewaddress and labels api
It is possible to mimic the same functionality of getaccountaddress using a label.

This is an example in python:

#!/usr/bin/env python3

import bitcoin.rpc

bitcoin.SelectParams('regtest')
proxy = bitcoin.rpc.Proxy()

def get_unused_address():
    label = 'donations'
    unused = None
    try:
        addr_list = proxy.call('getaddressesbylabel', label)
    except bitcoin.rpc.JSONRPCError as err: 
        if err.error['code'] == -11:
            # No addresses with label
            addr_list = None
    if addr_list:
        # Addresses with label found
        for addr in list(addr_list.keys()):
            # Check for tx received
            r = proxy.call('listreceivedbyaddress', 0, True, False, addr)
            if not len(r[0]['txids']):
                # Unused address found!
                unused = addr
                break
            else:
                # Used address found, remove label
                proxy.call('setlabel', addr, '')
    if not unused:
        # Address with label not found, generate a new one
        unused = proxy.getnewaddress(label)
    return unused

print("Unused address is: %s" % get_unused_address())