[CA-39743] Improvements to the wait_xen_free_mem function.
[CA-39743] Improvements to the wait_xen_free_mem function.

Improvements include:
* We read the values of free_memory and scrub_memory atomically (rather than separately).
* We exit early if (free_memory < required_memory) and (scrub_memory = 0) as it's unlikely that more will become free.
* We time out more quickly than before (64 seconds rather than 256 seconds).

Signed-off-by: Jonathan Knowles <47466d50a94574c6fb872a0e5feec104dcb68f29@eu.citrix.com>

huizh/xen-api,euanh/xen-api,rafalmiel/xen-api,Frezzle/xen-api,ravippandey/xen-api,robertbreker/xen-api,srowe/xen-api,agimofcarmen/xen-api,ravippandey/xen-api,euanh/xen-api,anoobs/xen-api,srowe/xen-api,jjd27/xen-api,vasilenkomike/xen-api,srowe/xen-api,anoobs/xen-api,anoobs/xen-api,Frezzle/xen-api,rafalmiel/xen-api,huizh/xen-api,simonjbeaumont/xen-api,vasilenkomike/xen-api,cheng--zhang/xen-api,vasilenkomike/xen-api,srowe/xen-api,rafalmiel/xen-api,salvocambria/xen-api,ravippandey/xen-api,cheng-z/xen-api,guard163/xen-api,cheng-z/xen-api,vasilenkomike/xen-api,guard163/xen-api,simonjbeaumont/xen-api,thomassa/xen-api,agimofcarmen/xen-api,cheng-z/xen-api,djs55/xen-api,simonjbeaumont/xen-api,robertbreker/xen-api,jjd27/xen-api,cheng-z/xen-api,jjd27/xen-api,koushikcgit/xen-api,anoobs/xen-api,euanh/xen-api,koushikcgit/xen-api,djs55/xen-api,jjd27/xen-api,cheng-z/xen-api,cheng--zhang/xen-api,simonjbeaumont/xen-api,rafalmiel/xen-api,robertbreker/xen-api,ravippandey/xen-api,simonjbeaumont/xen-api,djs55/xen-api,robertbreker/xen-api,koushikcgit/xen-api,djs55/xen-api,Frezzle/xen-api,jjd27/xen-api,anoobs/xen-api,robertbreker/xen-api,guard163/xen-api,Frezzle/xen-api,djs55/xen-api,vasilenkomike/xen-api,cheng-z/xen-api,koushikcgit/xen-api,salvocambria/xen-api,agimofcarmen/xen-api,jjd27/xen-api,agimofcarmen/xen-api,thomassa/xen-api,agimofcarmen/xen-api,cheng--zhang/xen-api,guard163/xen-api,salvocambria/xen-api,salvocambria/xen-api,koushikcgit/xen-api,ravippandey/xen-api,anoobs/xen-api,guard163/xen-api,huizh/xen-api,huizh/xen-api,koushikcgit/xen-api,cheng--zhang/xen-api,rafalmiel/xen-api,thomassa/xen-api,djs55/xen-api,robertbreker/xen-api,cheng--zhang/xen-api,thomassa/xen-api,srowe/xen-api,huizh/xen-api,vasilenkomike/xen-api,Frezzle/xen-api,euanh/xen-api,huizh/xen-api,cheng--zhang/xen-api,salvocambria/xen-api,euanh/xen-api,agimofcarmen/xen-api,euanh/xen-api,thomassa/xen-api,simonjbeaumont/xen-api,salvocambria/xen-api,thomassa/xen-api,guard163/xen-api,cheng-z/xen-api,rafalmiel/xen-api,ravippandey/xen-api,cheng--zhang/xen-api