Add timeout to the receive operation.