Also retry on 504 responses, add test to ensure timeouts are retried