After further investigation, what I have found is that it is OK to have the soft ap running, and have the UDP socket open with a callback assigned to pick up messages that come in on the port for the socket.
I can then scan repeatedly, until a message is sent to the socket. In my code, I simply deleted the packet that came in to eliminate the possibility that handling of the packet was corrupting memory. But once a message is received on the socket, the scanning no longer works. All the functions that set up the scan (wiced_wifi_scan_networks and its calls to support functions) return WICED_SUCCESS. But no events happen.
So I am not sure if this is a bug in the SDK, or if there is some expectation of cleanup (I have tried shutting down the soft ap, removing callbacks and deleting sockets to no avail).
Ok, I found the problem.
The reason that wiced_scan_wifi_networks was not working when I had the soft ap running and the udp server accepting messages was because I was calling it from the udp message received callback function.
Moving this outside of the callback fixed the problem.