Factor out bwlimit sleep code from writefd_unbuffered into its own function.